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

<cfwddx issue

Status
Not open for further replies.

Idee

Programmer
Jul 8, 2003
51
NZ
Hi

I have select box and onchange of this selectbox, in javascript function to which I pass optionid, I run
<cfwddx action="cfml2js" input="#Getvalue#" toplevelvariable="options">

Getvalue is a query which selects all the options and using wddxRecordset_findValue in javascript, I get the corresponding records and populate another selectbox.

Then I have div in my code which are hidden and displyed depending on the events.

Works well. But after I hit submit button and then I hit back browser button to come back to same page, first selectbox retains the value I have picked up before but the second select box values are lost.

The reason is that second select box is created on OnChange event of firstone and on onChnage event of second select box, certain div are made visible. so everything is lost except first selectbox.

Any way I can retain all the setting if I hit back button?

Any help is appreciated.

Thanks

 
Did you try setting some session variables? You could set the value of the variable(s) based on the value the user has selected in the select boxes. Then, add some code that evaluates the presence and value of the session variable(s), with some conditional breaks to set the value of the select box and the visibility of the div's. So, the first time the user hits the form page, the session variables will be null, so your form will appear in its default state. When the user makes a selection and hits "submit", the action page can set the session variables based on the values of the form variables. So if the user hits the "back" button, the session variables will have values, and these values will determine the state of the form (i.e., it should match the state it was in when the user hit the submit button).

blog.robsondesign.com
 
Thanks for your reply.

I have a problem here.. After submitting the form to the page, I can not create the session variables as I have no control over the page the form is submitted to. So I have to create the session variable in the same file where my form is.

In my code, I have a javascript function which is called onChange of first selectbox. In this function, I have to create a session variable and put the groupID passed to this function in the session variable. I can not do
<cfset session.groupid = groupID> in this function because
groupID is not a coldfusion variable and it is a javascript variable. Is there any way I can set the value of session variable using javascript variable?

function setSize(groupID){

}

Thanks for your help..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top