Gossamer Forum
Home : Products : DBMan : Customization :

Form Question

Quote Reply
Form Question
I have three forms on a page that I need to keep seperate to search the database. Does anyone know how I can on submittance of one form submit the values of the other two
forms with it?

By the way I have not set up the script yet but have made the form here.
www.marketuplinks.com/example3.htm

Thank You
Shane
Quote Reply
Re: Form Question In reply to
----------------

[This message has been edited by ChrisE (edited June 16, 1999).]
Quote Reply
Re: Form Question In reply to
I don't know how the javascript thing works. Are you sure you need to have three separate forms?


------------------
JPD





Quote Reply
Re: Form Question In reply to
The only reason why I need them in different forms is because they are three-way related menus, and I think the javascript references each form in order to know which one to change.

I tried to place all three into one form which worked but then I was getting errors when I selected another menu. www.marketuplinks.com/example.htm
Quote Reply
Re: Form Question In reply to
I just don't know enough about JavaScript to be able to help you. With any luck "dahamsta" will come by later and have some ideas.


------------------
JPD





Quote Reply
Re: Form Question In reply to
Hi Shane,

That's a big long script you have, and I'll be the first to admit I'm not a JavaScript expert, I just have an understanding of the basics, just like I do with Perl! Smile

As far as I can see, there's two ways you can go about this, and I'm not sure about either.

I'll have to have a look through the WebReference article for more detail on how it works, but I'll give you an idea first, you might be able to figure it out yourself.

My fist suggestion would be to add hidden fields to the third form, with the names of the fields from the other two select boxes. When the script operates normally using onChange, have it pass the value of the fields into the appropriate hidden field in the third form.

The other way to do it, would be to have all the fields in one form. I know you tried this already, but you probably didn't modify the script to match, therefore the script is trying to access forms that don't exist and is confusing its elements.

I'd be inclined to go for the first one, it'll probably require less modification. I'll try and have a look over it later today, but have a go off adding the first one yourself.

In the relate function, try something like:

Code:
var Field1Value = document.forms[formNum].SelectedIndex.value;
document.forms[2].Field1.value = FieldValue1;

... which, if the first hidden field in forms[2] (the third form) is called Field1, will set that field to the value of the select item you chose.

All pretty vague I know, but I don't know enough about the script to be more detailed.

adam
Quote Reply
Re: Form Question In reply to
THANK YOU for everyones help. I'v decided to try plan 'B', as the answer to this problem has been very hard to find.