Reply to topic
onclick select a radio box
Ennio


Joined: 17 Nov 2006
Posts: 101
Location: Scotch Plains, NJ
Reply with quote
How can I make when the user click on my text box, to select a radio box?

I'm using cfform.
Jason101
Forum Regular

Joined: 14 Mar 2006
Posts: 550
Location: Harrisburg, PA
Reply with quote
Ennio,

You just asked this in a previous post, and I gave you an answer:
http://forums.hostmysite.com/viewtopic.php?t=4607&highlight=

The cfform won't make a difference
Ennio


Joined: 17 Nov 2006
Posts: 101
Location: Scotch Plains, NJ
Reply with quote
that did not work for me
Jason101
Forum Regular

Joined: 14 Mar 2006
Posts: 550
Location: Harrisburg, PA
Reply with quote
Ennio,

Did you try the code I posted? Because I just tried it again and it worked.
Did you mean that the code I posted did not work when you tried it, or it did not accomplish what you want?
Ennio


Joined: 17 Nov 2006
Posts: 101
Location: Scotch Plains, NJ
Reply with quote
Jason, your code works in the HTML page alone but when I add it to my code it does not work.
here is my code.

Code:

<cfform name="frmQuestion" method="post" action="savetodb.cfm">
<cfif qryGetQuestion.type EQ 'radio'>
     <label><cfinput type="radio" name="#url.qt#" value="#value#" checked="#chk#">#value#</label>
</cfif>   
<cfif qryGetQuestion.type EQ 'radiot'>
   <label><cfinput type="radio" name="#url.qt#" value="#value#">#value#</label>&nbsp;&nbsp;&nbsp;&nbsp;<cfinput type="text" name="other" onClick="document.frmQuestion.#url.qt#[2].checked = yes">
</cfif>   
</cfform>
Jason101
Forum Regular

Joined: 14 Mar 2006
Posts: 550
Location: Harrisburg, PA
Reply with quote
Look at your code:

Code:

onClick="document.frmQuestion.#url.qt#[2].checked = yes


You have .checked= yes.

You need to have it .checked = true

Javascript is trying to set .checked to the variable "yes" which doesn't exist. In javascript you can only use true and false. yes or no don't exist.

Try that Smile
Ennio


Joined: 17 Nov 2006
Posts: 101
Location: Scotch Plains, NJ
Reply with quote
I tried that and still doesn't work.
strange..
onclick select a radio box
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic