Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

radio button/button/display text in another page depending on the radio button

New Here ,
Aug 07, 2006 Aug 07, 2006
hello there
i have this project wehre i have to diplay a text message about ten lines each based on choosing a radio button selection,then siplay it to another page (display page).
can this be don
and how???????????????
this is my code so far.


In my index.cfm page
I have this following code.


if the user clicks on
show message1/ First radio button then
it will display
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy


if the user clicks on
show message1/ Second radio button then
it will display
pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp



<td><label> For the: <br />
<input name="mygroup1" type="radio" value="show message1" />
First radio button
</label>
<p>
<label>
<input name=" mygroup1" type="radio" value=" show message2" />
second radio button
</label>
</p></td>


my submit button

<p>
<input type="submit" name="Submit" value="gotodiplaypage >>" />
</p>

--------------------------------------------------------------------------------------------------

when submit is pressed then it will go to

Display my stories page

Dis_mystories.cfm
TOPICS
Getting started
848
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Deleted User
Aug 08, 2006 Aug 08, 2006
try this....
Translate
Guest
Aug 07, 2006 Aug 07, 2006
on display page...

<cfif mygroup1 IS "show message1">
Message 1
<cfelseif mygroup1 IS "show message2">
Message 1
</cfif>

if you are sure "mygroup1" is going to post... this puts less load on server

<cfswitch expression="mygroup1">
<cfcase value="show message1">
Message 1
</cfcase>
<cfcase value="show message2">
Message 2
</cfcase>
</cfswitch>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 07, 2006 Aug 07, 2006
see attached code... also sent as message per your request....
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 08, 2006 Aug 08, 2006
i got these errors
how can i correct this??
thanks
here is the error

Error Occurred While Processing Request
Attribute validation error for tag CFCASE.
The tag does not allow the attribute(s) MESS1. The valid attribute(s) are DELIMITERS,VALUE.

The error occurred in D:\fff\ddd\ggg\radiobuttontextsample\display.cfm: line 7

5 : <cfoutput>
6 : <cfswitch expression=mygroup1>
7 : <cfcase value=show mess1>
8 : Text of Message 1
9 : </cfcase>

--------------
my index.cfm


</head>

<body>
<cfform action="display.cfm" method="POST" target="self">
<input type="radio" name="mygroup1" value="show mess1"> First radio button
<input type="radio" name="mygroup1" value="show mess2"> Second radio button
<input type="submit" name="Submit" value="Submit"
</cfform>
</body>
</head>

-------------------------
my display.cfm

<body>
<cfoutput>
<cfswitch expression=mygroup1>
<cfcase value=show mess1>
Text of Message 1
</cfcase>
<cfcase value=show mess2>
<p>Text of Message 2fffffffffffffffffffffffffffffffffffffffffffffffffffffffff</p>
<p>fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff </p>
</cfcase>
</cfswitch>
</cfoutput>
</body>



Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 08, 2006 Aug 08, 2006
LATEST
try this....
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources