Skip to main content
August 21, 2007
Question

Radio value + textarea value?

  • August 21, 2007
  • 2 replies
  • 323 views
I have a radio group, each with their own values and returns the value on the action page. I need to have one of the radio buttons also have a text area field next to it for manual user input. Is there a way to have it so that if that particular radio button was selected, it would also add the text area value along with it's original value?

So in other words,

Here's my radio group in a nutshell:
Button 1: Color Red
Button 2: Color Blue
Button 3: Color Green
Button 4: Color Black + [text area]

So on the action page, I need to have it show that if button 4 was selected, it would return the value: Color Black [text area].
If the user typed in "CAR" for [text area], it would return: Color Black CAR or something of the like.

I hope I'm not being too confusing on my question.

Thanks!
    This topic has been closed for replies.

    2 replies

    Inspiring
    August 21, 2007
    quote:

    Originally posted by: echoi
    I have a radio group, each with their own values and returns the value on the action page. I need to have one of the radio buttons also have a text area field next to it for manual user input. Is there a way to have it so that if that particular radio button was selected, it would also add the text area value along with it's original value?

    So in other words,

    Here's my radio group in a nutshell:
    Button 1: Color Red
    Button 2: Color Blue
    Button 3: Color Green
    Button 4: Color Black + [text area]

    So on the action page, I need to have it show that if button 4 was selected, it would return the value: Color Black [text area].
    If the user typed in "CAR" for [text area], it would return: Color Black CAR or something of the like.

    I hope I'm not being too confusing on my question.

    Thanks!

    You can concatonate text in cold fusion using an ampersand. Your code would resemble

    if (something about the radio button)
    NewVar = "new text " & SomeSeparator & form.textarea;
    else
    NewVar = form.textarea;

    Then work with NewVar instead of form.textarea.
    existdissolve
    Inspiring
    August 21, 2007
    On your action page, do a <cfif> evaluation like this:

    <cfif isDefined("FORM.black")>
    <cfoutput>#FORM.mytextarea#</cfoutput>
    </cfif>