Skip to main content
Participant
August 7, 2006
解決済み

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

  • August 7, 2006
  • 返信数 2.
  • 946 ビュー
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
このトピックへの返信は締め切られました。
解決に役立った回答
try this....

返信数 2

August 8, 2006
see attached code... also sent as message per your request....
Participant
August 8, 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>



解決!
August 8, 2006
try this....
August 7, 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>