Ask a Question related to Coldfusion - Getting Started, Design and Development.
-
JMSB #1
Refer to a button in a form by ID rather than name
Hi,
I would like to know if there is a way to call or refer to the radio button
with it's id tag not 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 = "http://www.google.com/u/concordiau?q=/#FORM.Search#">
<CFSET myVAR2 = "http://www.google.com/u/jmsb?q=/#FORM.Search#">
<cfif isdefined("FORM.Jmsb")>
<cflocation url= "#myVAR2#" addtoken="no">
</cfif>
<cfif isdefined("FORM.Conc")>
<cflocation url= "#myVAR1#" addtoken="no">
</cfif>
JMSB Guest
-
Form button help
Hello, I'm working in MX2004. I've made a Form so that someone can fill out their info and submit it to a mailing list. The layout and presentation... -
slave buttons that refer to master button actions
Hi Just as the message title says, I'm looking to have 50 buttons refer to a get URL action contained in a master button (which is in the same... -
Problem with Button using Form.pm
Hi, I have a page with a Input Type Button : <INPUT TYPE="button" NAME="_wiznext" VALUE=" Next " ONCLICK="openURL(this.form);"> But I am... -
Form Search Button
Hi I have almost finished a database and it does everything I want it to at the moment except one thing. On the Forms that I have made, I have... -
JavaScript Access to Button in form tags (webcontrol or html button)
Hello, I have a button called LoadBtn, which exists in <form name="Form1" runat=server></form> tags. I then have javascript loaded outside of... -
Dan Bracuk #2
Re: Refer to a button in a form by ID rather than name
Why don't you give them the same name and different values? That way, they
would act like radio buttons.
Originally posted by: JMSB
Hi,
I would like to know if there is a way to call or refer to the radio button
with it's id tag not 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.
Dan Bracuk Guest
-
BKBK #3
Re: Refer to a button in a form by ID rather than name
Hi JMSB
In my opinion, this is sufficient -- without id attribute, and without end-tag,
unless you're using xhtml, etc.
p><input type="radio" accesskey="J" name="type" value="J"> JMSB </p>
<p><input type="radio" accesskey="C" name="type" value="C"> DIS </p>
BKBK Guest
-
cf_menace #4
Re: Refer to a button in a form by ID rather than name
When you're using a group of radio buttons and want to restrict that only one
be chosen, they all have to have the same name. In order to process the
selected radio button, you should setup a default value for the element in case
none are chosen, then you'll have to check each possible value if you doing
something different per possible value.
<!--- formPage.cfm --->
<form name="someForm" action="actionPage.cfm">
<p><input type="radio" name="type" value="J" /> J</p>
<p><input type="radio" name="type" value="C" /> C</p>
</form>
<!--- actionPage.cfm --->
<cfparam name="form.type" type="string" default="" />
<cfif form.type IS "J">
<cflocation url= "#myVAR2#" addtoken="no">
</cfif>
<cfif form.type IS "C">
<cflocation url= "#myVAR1#" addtoken="no">
</cfif>
<!--- OR --->
<cfparam name="form.type" type="string" default="" />
<cfswitch expression="#form.type#">
<cfcase value="J">
<cflocation url= "#myVAR2#" addtoken="no">
</cfcase>
<cfcase value="C">
<cflocation url= "#myVAR1#" addtoken="no">
</cfcase>
<cfdefaultcase>
<cflocation url= "formPage.cfm?err=1" addtoken="no">
</cfdefaultcase>
</cfswitch>
cf_menace Guest
-
JMSB #5
Re: Refer to a button in a form by ID rather than name
Thx alot cf_menace........you rock :)...It worked
JMSB Guest
-
JMSB #6
Re: Refer to a button in a form by ID rather than name
Thx alot cf_menace........you rock :)...It worked
JMSB Guest



Reply With Quote

