calling two forms in a functions

Results 1 to 2 of 2

Thread: calling two forms in a functions

  1. #1
    Join Date
    Dec 1969

    Default calling two forms in a functions

    hey, can someone give an example in javascript of setting the text value on one form to the text value on another form....both forms on the same page.thanks.<BR>:)

  2. #2
    Join Date
    Dec 1969

    Default It's easy, but why?

    You can only submit ONE form per page.<BR><BR>Well, not quite true. You could submit one form to a different target (e.g., to another &#060;FRAME&#062; or popup window).<BR><BR>Unless you are doing that, though, why have two forms?<BR><BR>And when do you want to do this? When one of the forms is submitted? When the value of some form field is changed?<BR><BR>That basic code is dirt simple:<BR><BR>document.Form2.Field2.value = document.Form1.Field1.value;<BR><BR>But if you are invoking this from the field that is changing, say, you can shorten it considerably:<BR><BR>&#060;FORM Name="Form1"&#062;<BR>&#060;INPUT Name="doesNotMatter" onChange="document.Form2.Field2.value=this.value;" &#062;<BR>&#060;/FORM&#062;<BR><BR>&#060;FORM Name="Form2"&#062;<BR>&#060;INPUT Name="Field2"&#062;<BR>&#060;/FORM&#062;<BR><BR>

Posting Permissions

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