To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > Misc Help > ClientSide Technologies

ClientSide Technologies Discuss HTML/CSS/Javascript, and any other client-side technologies, here.

Reply
 
Thread Tools Rate Thread Display Modes
Old 03-25-2006, 12:46 AM   #1
NZ_Kiwis
Senior Member
 
Join Date: Apr 2005
Posts: 699
Box not filled in

I want a code so when a textbox has no text in it and a user click the submit button it pops up saying you have not filled in the box!!!

i need to code to be able to have a number of boxes that need information
NZ_Kiwis is offline   Reply With Quote
Old 03-25-2006, 01:19 AM   #2
bradgrafelman
Pna lbh ernq guvf?
 
Join Date: Jul 2004
Location: 40.566N -89.731W, ~469ft above sea level
Posts: 11,488
Code:
<script type="text/javascript">

function checkIt() {

     f = document.theForm;

     if(f.whatever.value == '' || f.etc.value == '') {
          alert('Error: You must fill out all required fields.');
          return false;
     } else return true;

}
</script>
<form name="theForm" onsubmit="return checkIt()">
<textarea name="whatever"></textarea>
<input type="text" name="etc" />
</form>
__________________
***If your problem has been solved, PLEASE click the RESOLVED LINK under "Thread Tools"***

"Well Bones, do the new medical facilities meet with your approval?" -- Kirk
"They do not. It's like working in a damn computer center" -- McCoy (Star Trek: TMP)

Useful links: Debugging 101 || NJOE || (Sig image) || Rolla Engineered Solutions, LLC
bradgrafelman is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 11:38 AM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.