jeff5656 Posted April 6, 2008 Share Posted April 6, 2008 I have a calendar pop js and and required field js. For some reason, adding the calendar one makes the other one not work. I am sure it has something to do with the code near the submit button? The js scripts in the header: <SCRIPT LANGUAGE="JavaScript" SRC="../CalendarPopup.js"></SCRIPT> <SCRIPT LANGUAGE="JavaScript"> var cal = new CalendarPopup(); </SCRIPT> <script type="text/javascript" src="../formvalidator.js"></script> <script type="text/javascript"> <!-- function check(formname, submitbutton) { var errors = ''; errors += checkText(formname, 'your_name', 'Your Name'); errors += checkText(formname, 'mrn', 'MRN'); errors += checkText(formname, 'name', 'Your Name'); errors += checkText(formname, 'card_no', 'Card No.'); return checkThisForm(formname, submitbutton, errors); } //--> The key parts of the form: <form id="cin" name="cin" method="post" action="cin_addpatient.php"> <table> <th>Your Name</th> <td><input type="text" name="your_name" /></td> </tr> <tr></tr> <th>Patient Last Name</th> <td><input type="text" name="name" /></td> </tr> <tr></tr> <th>Card No.</th> <td><input type="text" name="card_no" id="card_no" /></td></tr> <tr></tr> <th>Date of enrollment</th> <tr> <td><input type="text" name="date_enroll" id="date_enroll" /> <A HREF="#" onClick="cal.select(document.forms['cin'].date_enroll,'anchor1','MM/dd/yyyy'); return false;" NAME="anchor1" ID="anchor1"><img src="../calendaricon.gif" width="16" height="16" border="0"></A></td></tr> and the code near the submit button: <input type="submit" name="Submit" value="Add Patient" onClick="return check('newreminders', this.name)"> The calendar script works on the form, but not the required fields. If I don't enter something, the form still gets processed. Quote Link to comment Share on other sites More sharing options...
jeff5656 Posted April 6, 2008 Author Share Posted April 6, 2008 Uh oh, 33 views and no solution. Maybe you can't have more than one java scripst share the same submit button? Quote Link to comment Share on other sites More sharing options...
jeff5656 Posted April 7, 2008 Author Share Posted April 7, 2008 anyone want to guess? I know very little about js so I cannot really even go about trying to dubug this on my own. Quote Link to comment Share on other sites More sharing options...
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.