• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Persisting Radio Buttons on Redirect from a Radio Button

Participant ,
Aug 25, 2006 Aug 25, 2006

Copy link to clipboard

Copied

Hi I have a form page and on one of the questions if a radio button is clicked it takes me to another page. How can I persist the top buttons to a session struct for use later if the client clicks the return to form button which is on the redirect page. Here is my code.

Javascript in the head.
<script>
function leapTo (link)
{
var new_url=link;
if ( (new_url != "") && (new_url != null) )
window.location=new_url;
}
</script>
QUESTIONS TO PERSIST TO A SESSION SCOPE
<input name="Question1" type="radio" value="0" <cfif form.question1 EQ 0>Checked</cfif>>Program Manager, Office Director, or Team Leader<br>
<input name="Question1" type="radio" value="1" <cfif form.question1 EQ 1>Checked</cfif>>Technology Development Manager<br>
<input name="Question1" type="radio" value="2" <cfif form.question1 EQ 2>Checked</cfif>>Budget Analyst<br>
<input name="Question1" type="radio" value="3" <cfif form.question1 EQ 3>Checked</cfif>>DOE Contractor<br>
<input name="Question1" type="radio" value="4" <cfif form.question1 EQ 4>Checked</cfif>>Other<br>

REDIRECT QUESTION

<input onClick="leapTo('poll.cfm')" name="Question6" type="radio" value="5" <cfif form.question6 EQ 5>Checked</cfif>>I do not rely on support contractors
to use CPS and enter/retrieve data totally on my own<br>

BACK BUTTON
<input onClick="leapTo('survey.cfm')" name="Back" type="submit" value="Go Back"/>

TOPICS
Advanced techniques

Views

405

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 26, 2006 Aug 26, 2006

Copy link to clipboard

Copied

Instead of using javascript on the question 6 radio button, submit the form. Then convert your fomr variables to session variables and your are off to the races.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 26, 2006 Aug 26, 2006

Copy link to clipboard

Copied

Dan, how would I submit the form using the onclick event for Question 6? Can you show me the code for that? Thanks,

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 26, 2006 Aug 26, 2006

Copy link to clipboard

Copied

LATEST
onclick="this.form.submit();"

or something like that.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation