By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,035 Members | 969 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,035 IT Pros & Developers. It's quick & easy.

adressing forms

100+
P: 132
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:

Expand|Select|Wrap|Line Numbers
  1. if (window.frames["content"].document.FORMNAME.day.value="")
  2.     {
  3.     alert("Date has not been filled in.");
  4.     break;
  5.     }
  6.  
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
Jun 10 '08 #1
Share this Question
Share on Google+
3 Replies


gits
Expert Mod 5K+
P: 5,390
i think you mean something like:

Expand|Select|Wrap|Line Numbers
  1. document[FORMNAME]day
with that you may use any formname-string ...

kind regards
Jun 10 '08 #2

100+
P: 132
Yet again Gits to the rescue!

Thank you very much.

Greets,

Cainnech
Jun 12 '08 #3

gits
Expert Mod 5K+
P: 5,390
:) no problem ... post back to the forum anytime you have more questions ...

kind regards
Jun 12 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.