JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old April 29th, 2004, 07:55 AM
241 241 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 4 241 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 46 m 34 sec
Reputation Power: 0
Lightbulb passing a form that requires function of other form

Hi Newbie here,

I am trying to get a solution for a tracking form that is very basic
Code:
<FORM ACTION="https://obc.canadapost.ca/emo/basicPin.do" method="post" TARGET="_blank">
<input type="hidden" name="AppLanguage" value="En"> 
<input type="text" size="30" name="temp_trkid1"><br><br>
<input type="submit" value="Track Package">
<input type="reset" value="Reset" >
</FORM>


this auto fills the form on the page being posted however I cannot get the form to auto execute the submit of the other form in order to get a result. The other form uses this for the submit button
Code:
<input type="button" class="bluebutton" value="&nbsp;&nbsp;&nbsp;Submit&nbsp;&nbsp;&nbsp;" onclick="submitPIN('basicPinForm');">
as you can see this in turn is calling a function submitPIN with object basicPinForm

The function submitPIN consists of
Code:
function submitPIN(obj) {
if (obj=="") return;
var formObj = eval("document." + obj);
if (!validate(formObj.temp_trkid1.value)) {
alert('Invalid characters in the input fields. Please check your entries and try again.');
return;
} 
if (formObj.temp_trkid1.value=="") {
alert('No Item number was submitted. Please enter a number and click Submit.');
return;
}
/* done in the form
if (!numberOfItems(formObj.temp_trkid1.value)) {
alert('Maximum number of Items you can search for is 24');
return;
}
*/
formObj.trackingId.value=formObj.temp_trkid1.value  ;
formObj.trackingCode.value='PIN';
formObj.submit();
}



I had tried numerous methods to get this to work, but to no avail. I do not know if this can be done with an onSubmit, the form is on one server with access to it and the other form on another server that is the distribution service server and has no access to the files, thus everything has to be done from the one form.

Does anyone know of a solution to get the posted form to activate the submit of the other form this form will be either in html php or javascript if it is resolvable.

If this is not at all possible can someone let me know as my head is getting sore from banging it against this brick wall.

Many thanks in advance

Reply With Quote
  #2  
Old May 2nd, 2004, 08:05 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Posts: 2,056 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 44 m 22 sec
Reputation Power: 0
Firstly, don't use onClick on a submit button. You will break the form. Use the "onsubmit" event on the form object to do any last minute processing, and return either true/false.

Secondly, in your code, you have "onclick="submitPIN('basicPinForm');"", what is 'basicPinForm' - I couldn't see anything in your code with that name?

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > passing a form that requires function of other form


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap