Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can two forms share values within a function

Status
Not open for further replies.

mat41

Programmer
Mar 7, 2004
91
AU
Good day

Should I be able to do this?

function showCatsSubmit(catId,catName)
{
showCats.id.value = catId;
showCats.catName.value = catName;
showCats.submit();
showCats.eventTitle.value = createNewEvent.eventTitle.value
}

I have two forms on a page:
1..showCats
2..createNewEvent

My objective is to submit showCats, reload the page, then pass the value in showCats.eventTitle to createNewEvent.eventTitle

'ShowCats' is completely hidden. It is used to show a tree structure of items within a category, each with a checkbox for selection. 'createNewEvent' is seen on the page however when a category is selected ('ShowCats' is submitted) to show its tree items of course I loose the values any 'createNewEvent' form input fields.

mmmmmm, I haven’t coded a page this way before but logically it seems like it should be possible. I get no error's, everything is defined, the submit function runs fine, the tree works fine. Should I be able to say? (line 6 of the function above):

showCats.eventTitle.value = createNewEvent.eventTitle.value

TYIA
 
Please dis regard the above post, missing semi colons was stopping it. I was under the impression that should have given me an error since I have told IE to give me script errors.

TY
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top