User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 427,229 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,226 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 412 | Replies: 2 | Solved
Reply
Join Date: Oct 2007
Posts: 30
Reputation: Tom Tolleson is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
Tom Tolleson Tom Tolleson is offline Offline
Light Poster

why won't this script work?

  #1  
Aug 8th, 2008
Any input is appreciated.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script language="text/javascript">
function validateForm(form1)
{
alert("Please enter your name.");

}
</script>
</head>

<body>
<form name="form1" id="form1"  method="post" onSubmit="validateForm(form1);">
<input type="text" id="name" name="name" /> 
<input type="submit" name="SubmitName" value="Submit" />  
</form>
</body>
</html>
Last edited by Tekmaven : Aug 8th, 2008 at 4:33 pm. Reason: Code tags
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2008
Posts: 137
Reputation: essential is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 20
essential essential is offline Offline
Junior Poster

ReModified

  #2  
Aug 8th, 2008
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  4. <title>Untitled Document</title>

  1. <script type="text/javascript">
  2. <!--Begin Hiding
  3.  
  4. //I just modified your code. Pls. Take a good look.
  5.  
  6. function validateForm(form)
  7. {
  8. alert('Please enter your name.');
  9. }
  10. // Done Hiding -->
  11. </script>

  1. </head>
  2. <body>
  3. <form name="form1" method="post" onSubmit="validateForm(this.form);">
  4. <input type="text" id="name" /> <input type="submit" name="SubmitName" value="Submit" />
  5. </form>
  6. <!-- Hope it helps you, enjoy your coding...-->
  7. </body>
  8. </html>
Mastery is not something that strikes in an instant. Through the study of technique, one learns the best most efficient ways of making characters come alive...
Reply With Quote  
Join Date: Oct 2007
Posts: 30
Reputation: Tom Tolleson is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
Tom Tolleson Tom Tolleson is offline Offline
Light Poster

Re: why won't this script work?

  #3  
Aug 14th, 2008
Yes, thank you very much!
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JavaScript / DHTML / AJAX Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 11:44 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC