adressing forms

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Cainnech
    New Member
    • Nov 2007
    • 132

    adressing forms

    Hi guys,

    Another question from me, sorry :-)

    I have a webpage with multiple forms in it but where some fields have the same name. Only one form can be used at a time.

    I'm making a script that performs a check on the form. But instead of using a checkfunction for every form, I would like to use a single check which can be performed at the active form.

    Right now I'm using something like this:

    Code:
    if (window.frames["content"].document.FORMNAME.day.value="")
    	{
    	alert("Date has not been filled in.");
    	break;
    	}
    I would like to change the FORMNAME to something that can be used universally. I was thinking about using THIS.FORM but that doesn't work.

    Anyone have any ideas on this?

    Thanks,

    Cainnech
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5390

    #2
    i think you mean something like:

    [CODE=javascript]document[FORMNAME]day[/CODE]
    with that you may use any formname-string ...

    kind regards

    Comment

    • Cainnech
      New Member
      • Nov 2007
      • 132

      #3
      Yet again Gits to the rescue!

      Thank you very much.

      Greets,

      Cainnech

      Comment

      • gits
        Recognized Expert Moderator Expert
        • May 2007
        • 5390

        #4
        :) no problem ... post back to the forum anytime you have more questions ...

        kind regards

        Comment

        Working...