why won't this script work?

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved

Join Date: Oct 2007
Posts: 39
Reputation: Tom Tolleson is an unknown quantity at this point 
Solved Threads: 0
Tom Tolleson's Avatar
Tom Tolleson Tom Tolleson is offline Offline
Light Poster

why won't this script work?

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

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  5. <title>Untitled Document</title>
  6. <script language="text/javascript">
  7. function validateForm(form1)
  8. {
  9. alert("Please enter your name.");
  10.  
  11. }
  12. </script>
  13. </head>
  14.  
  15. <body>
  16. <form name="form1" id="form1" method="post" onSubmit="validateForm(form1);">
  17. <input type="text" id="name" name="name" />
  18. <input type="submit" name="SubmitName" value="Submit" />
  19. </form>
  20. </body>
  21. </html>
Last edited by Tekmaven; Aug 8th, 2008 at 5:33 pm. Reason: Code tags
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 954
Reputation: essential will become famous soon enough essential will become famous soon enough 
Solved Threads: 131
Featured Poster
essential's Avatar
essential essential is offline Offline
Posting Shark

ReModified

 
0
  #2
Aug 9th, 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>
Dev.Opera — FOLLOW THE STANDARDS, BREAK THE RULES...
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 39
Reputation: Tom Tolleson is an unknown quantity at this point 
Solved Threads: 0
Tom Tolleson's Avatar
Tom Tolleson Tom Tolleson is offline Offline
Light Poster

Re: why won't this script work?

 
0
  #3
Aug 14th, 2008
Yes, thank you very much!
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC