Submit one form from another form?

Results 1 to 2 of 2

Thread: Submit one form from another form?

  1. #1
    Ramakrishna Guest

    Default Submit one form from another form?

    How to submit a form form another form?<BR><BR>If i have a page divided into 2 frames: left.asp and right.asp<BR>in left.asp i have say three text boxes, in right.asp say i have 4 text boxes with a submit button, when i click this submit button in right.asp i want the fields of the left.asp to be posted alongwith right.asp.<BR><BR>Try this and help me out<BR><BR><BR><BR>

  2. #2
    icabod Guest

    Default RE: Submit one form from another form?

    Since you probably want both sides to be processed at the same time, on the same script, you should really only have one form sending in data... so let&#039s try this:<BR><BR>- left.asp will run a javascript function that will pass form values into hidden fields in right.asp. This will be triggered by an onBlur event in each field.<BR>- right.asp wil contain ALL values for BOTH forms (tho some are hidden) and then be submitted. You should probably run a validator script on this too, if you want the fields in left.asp to be required...<BR><BR>Here is some sample code for left.asp:<BR><BR>&#060;script language="JavaScript"&#062;<BR>function MoveThisValue()<BR>{<BR>// form 2 (g) is given value from form 1 (f)<BR>document.g.leftvalue1.value = document.f.leftvalue1.value;<BR>}<BR>&#060;/script&#062;<BR>&#060;!-- Name the form "f" --&#062;<BR>&#060;FORM NAME=f&#062;<BR>&#060;INPUT TYPE="TEXT" NAME="leftvalue1" onBlur="MoveThisValue();"&#062;<BR>&#060;/FORM&#062;<BR><BR>-----<BR><BR>then put this in right.asp:<BR><BR>&#060;FORM NAME="g"&#062;<BR>&#060;INPUT TYPE="HIDDEN" NAME="leftvalue1" VALUE=""&#062;<BR>&#060;/FORM&#062;<BR>-----<BR><BR>This is kinda crude and I haven&#039t debugged it.. but the concept is there (I think). You may have to add your own statements to it (if/then&#039s, etc) to handle empty values... see what develops.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts