NBS Posted April 13, 2009 Report Share Posted April 13, 2009 Sveiki, man nezin kāpēc nestrādā šis kods: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>mmmm</title> <script type="text/javascript"> function validate() { var darbalaiks = getElementById("darb_laiks").value; if (darbalaiks == "") { alert("Darba laiks ir atstāts tukšs!"); } } </script> <form method="POST" action="a.htm" onsubmit="return validate();"> <input type="text" id="darb_laiks" name="darb_laiks" value="" /> <input type="submit" name="submit" value="OK" /> </form> </html> Quote Link to comment Share on other sites More sharing options...
0 bubu Posted April 13, 2009 Report Share Posted April 13, 2009 Kā izpaužas nestrādāšana? Javaskript kļūda? Kāda? Pirms getElementById nav jāliek priekšā document. ? No validate() fjas derētu atgriezt arī boolean vērtību true vai false, jo tu tu izmanto return kontekstā. Quote Link to comment Share on other sites More sharing options...
0 NBS Posted April 13, 2009 Author Report Share Posted April 13, 2009 Paldies :) Biju piemirsis. Quote Link to comment Share on other sites More sharing options...
Question
NBS
Sveiki, man nezin kāpēc nestrādā šis kods:
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.