2 scripts in one phpo file not working

This is a discussion on "2 scripts in one phpo file not working" within the JavaScript Forum section. This forum, and the thread "2 scripts in one phpo file not working are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Apr 6th, 2008, 16:38
New Member
Join Date: Apr 2008
Location: us
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
2 scripts in one phpo file not working

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?

Code: Select all
<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:
Code: Select all
<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" />&nbsp;<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:
Code: Select all
 <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.
Reply With Quote

  #2 (permalink)  
Old Apr 7th, 2008, 12:27
spinal007's Avatar
Moderator
Join Date: Mar 2004
Location: Good Ol'London
Age: 22
Posts: 1,620
Blog Entries: 1
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via ICQ to spinal007 Send a message via MSN to spinal007 Send a message via Yahoo to spinal007 Send a message via Skype™ to spinal007
Re: 2 scripts in one phpo file not working

where's the definition of checkThisForm?
looks like the problem is that "checkThisForm" is returning true even when an error happens.
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
Reply With Quote
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling .php file from a perl scripts dhossai Other Programming Languages 0 Jan 12th, 2008 21:25
Scripts MetallicWarfare PHP Forum 0 Aug 3rd, 2007 12:03
Lightbox not working in iEx when called from swf-file photoguy1601 JavaScript Forum 9 Jun 15th, 2007 20:29
Creating a log file (text file) and an XML file using XSL kdelacruz Other Programming Languages 1 Nov 4th, 2006 21:12
Working with Form 'file field' data in ASP. daryl Classic ASP 3 Jun 24th, 2006 20:22


All times are GMT. The time now is 19:41.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43