Easy A
Would you like to react to this message? Create an account in a few clicks or log in to continue.


 
HomeHome  Latest imagesLatest images  SearchSearch  RegisterRegister  Log inLog in  

Share
 

 Default to a radio button onclick or onload

View previous topic View next topic Go down 
AuthorMessage
simonheros
Member
Member
simonheros

Posts : 2
Join date : 2011-04-17

Default to a radio button onclick or onload Empty
PostSubject: Default to a radio button onclick or onload   Default to a radio button onclick or onload EmptyThu Jun 23, 2011 5:40 am

Hello I can't figure out how to code this. Right now I have 3 radio buttons edit/print/search. I need it to go back to the edit radio button either onclick or onload. Don't know what would be better. My codding looks like this so far:

<input type="radio" name="radiooption" value="Edit"<cfif #Session.radiooption# IS "Edit">CHECKED</cfif> onClick="this.form.submit();">Print<input type="radio" name="radiooption" value="Print"<cfif #Session.radiooption# IS "Print">CHECKED</cfif> onClick="this.form.submit();">search<input type="radio" name="radiooptione" value="search"<cfif #Session.radiooption# IS "search">CHECKED</cfif> onClick="this.form.submit();"></font>

<input type="button" name="ClearLabels" value="Clear Labels" style="font-size: 9px;" onClick="this.form.submit();">

What I need done in the end is when Clear Labels is clicked. I need it to clear the label que (which it does that now), but I need it to also go back to the edit radio (#Session.radiooption# IS "Edit") radio button. What would the best way to do this be?
Back to top Go down
Athos
Member
Member
Athos

Posts : 2
Join date : 2011-04-18

Default to a radio button onclick or onload Empty
PostSubject: Re: Default to a radio button onclick or onload   Default to a radio button onclick or onload EmptyThu Jun 23, 2011 5:40 am

I don't know what <cfif> is so I have left them out of answer.
2. I put things in lower case because that's how their should be.
3. I am guessing, because you are submitting form for every action, that your page is being re-displayed all the time. So the answer is in the way the radio buttons are displayed:
Code:

Edit  <input type="radio" name="radiooption" value="Edit" checked="true" onclick="this.form.submit();">
<br />
Print <input type="radio" name="radiooption" value="Print" onclick="this.form.submit();">
<br />
Search<input type="radio" name="radiooption" value="search" onclick="this.form.submit();">
Back to top Go down
Splashy
Member
Member
Splashy

Posts : 5
Join date : 2011-04-18

Default to a radio button onclick or onload Empty
PostSubject: Re: Default to a radio button onclick or onload   Default to a radio button onclick or onload EmptyThu Jun 23, 2011 5:42 am

Your HTML code should probably look like this in general:
Code:

Edit <input type="radio" name="radioOption" value="Edit" onclick="this.form.submit();" <cfif session.radioOption eq "edit">checked="true"</cfif>><br />

Print <input type="radio" name="radioOption" value="Print" onclick="this.form.submit();" <cfif session.radioOption eq "print">checked="true"</cfif>><br />

Search <input type="radio" name="radioOption" value="search" onclick="this.form.submit();" <cfif session.radioOption eq "search">checked="true"</cfif>><br />

<input type="button" name="ClearLabels" value="Clear Labels" style="font-size: 9px;" onClick="this.form.submit();">
Back to top Go down
simonheros
Member
Member
simonheros

Posts : 2
Join date : 2011-04-17

Default to a radio button onclick or onload Empty
PostSubject: Re: Default to a radio button onclick or onload   Default to a radio button onclick or onload EmptyThu Jun 23, 2011 5:42 am

Sorry. Didn't realize I was in Cold Fusion section
Back to top Go down
Sponsored content




Default to a radio button onclick or onload Empty
PostSubject: Re: Default to a radio button onclick or onload   Default to a radio button onclick or onload Empty

Back to top Go down
 

Default to a radio button onclick or onload

View previous topic View next topic Back to top 
Page 1 of 1

 Similar topics

-
» Default namespace and XSLT
» when i save swf file winamp is default viewer and swf files are with winamp icon
» how to create a pop out button
» Submit button
» Report button

Permissions in this forum:You cannot reply to topics in this forum
Easy A :: Default to a radio button onclick or onload Edit-trash Useless :: Trash-