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

Refer to a button in a form by ID rather than name

Status
Not open for further replies.

3allawy

Programmer
Oct 19, 2005
28
CA
Hi,

I would like to know if there is a way to call or refer to the radio button with it's id tag other than the name because when I have the two different names for my radio buttons I am facing a problem.

The problem is that when you select one of my two radio buttons and submitt the form, that button stays checked, even if you select the other button.

----------------------html form------------------
<form id="quicksearch" name="quicksearch" action="scripts/search.cfm" method="post">

<label for="quicksearchBox">Search:</label> <input class="styledinput" tabindex="1" accesskey="S" type="text" name="Search" id="quicksearchBox" size="9" /><input class="styledinput" tabindex="2" type="submit" value="Go" id="quicksearchButton" /><br /><br />

<p><input type="radio" accesskey="J" name="type" id="Jmsb" value="J"/> JMSB </p>

<p><input type="radio" accesskey="C" name="type" id="Conc" value="C" /> DIS </p>
----------------------------------------------------------
cfm file

<CFSET myVAR1 = "<CFSET myVAR2 = "
<cfif isdefined("FORM.Jmsb")>
<cflocation url= "#myVAR2#" addtoken="no">
</cfif>

<cfif isdefined("FORM.Conc")>
<cflocation url= "#myVAR1#" addtoken="no">
</cfif>
 
radio buttons are supposed to toggle. they're SUPPOSED to have the same names.

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
I understsad that they should have the same names but my question was " is there a way to call or refer to the radio button with it's id tag other than the name"

thx for replying
 
ID isn't passed to the server only name.

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top