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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form values not saving

Status
Not open for further replies.

amethystct

Programmer
Jan 26, 2004
21
FR
I have a form w/ 5 selects. When you first enter this page only the first select is filled. Once the user selects one of the options I want it to refresh the page so I can fill the next select based. And so on for each select list. I have a server side process that's called whenever the page is refreshed but for some reason, if I just refresh the page, it doesn't store the value that I've selected. If I instead make a selection and hit the submit button (for a different process) then the value is saved.

I've tried including hidden fields for the values and setting the form values in the refresh function but it doesn't work.

What am I doing wrong?

function refreshMe() {
// document.forms.theform._D:areaNbr.value = document.forms.theform.areaNbr.value;
// document.forms.theform.whseCode.value = document.forms.theform.whseCode.value;
// document.forms.theform.contractNbr.value = document.forms.theform.contractNbr.value;
// document.forms.theform.aomsNumber.value = document.forms.theform.aomsNumber.value;
// document.forms.theform.poNumber.value = document.forms.theform.poNumber.value;
window.location.reload();
}

<TD ALIGN=&quot;LEFT&quot; NOWRAP><B>Area RSLs:</B></TD>
<TD WIDTH=&quot;70%&quot;> <select NAME=&quot;areaNbr&quot; CLASS=&quot;select&quot;>
<OPTION VALUE=&quot;&quot;>
<option VALUE=&quot;1101 &quot;>Pennsylvania/New Jersey Area
<option VALUE=&quot;1102 &quot;>New England Area
</select></TD>
 

The values are only passed to the server-side on form submission, not refresh. So you'd need to submit your page each time to keep the values you've already selected.

Hope this helps!

Dan
 
Crud!! Is there any way to make a hidden submit when the value of the select is changed? I can't have them press the other button
 
re: hidden submit

you could submit the data in a hidden frame but not sure it would be very reliable.

----------
I'm willing to trade custom scripts for... [see profile]
 

>> you could submit the data in a hidden frame but not sure it would be very reliable

That's exactly how 2 investment banks I've worked for have done their form submissions.. Using a communication frame.. It's a well-used technique, and perfectly stable if coded correctly.

That, of course, assumes you're OK using frames (or iframes)

Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top