Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

radio button checked after submit failed 1

Status
Not open for further replies.

xue

Programmer
Feb 5, 2001
12
0
0
US
I have three radio buttons. after select one radio button and hit submit,
I Want the button stays selected after submit fails. but so far, there is no luck.
if there is a way that I can use the id in radio button, please tell me a way.
thank you very much.
the following code says that I give three radio buttons three different values
and after knowing which button is selected, then I insert my stuff. after everything,
i am trying to assign the last value back to the text(so "check" to selected radio button)


Dim btnOnline
Dim btnFax
Dim btnMail
btnOnline = "byonline"
btnFax = "byfax"
btnMail = "bymail"

If Request.Form(&quot;blnCreditCard&quot;) <> &quot;&quot; Then
If Request.Form(&quot;IsCredit&quot;) = &quot;byonline&quot; Then
btnOnline = Request.Form(&quot;IsCredit&quot;)
ElseIf Request.Form(&quot;IsCredit&quot;) = &quot;byfax&quot; Then
btnFax = Request.Form(&quot;IsCredit&quot;)
Else
btnMail = Request.Form(&quot;IsCredit&quot;)
End If
.......
End If

If Request.Form(&quot;IsCredit&quot;) = &quot;byonline&quot; Then
btnOnline = &quot; CHECKED &quot;
btnFax = &quot;&quot;
btnMail = &quot;&quot;
ElseIf Request.Form(&quot;IsCredit&quot;) = &quot;byfax&quot; Then
btnOnline = &quot;&quot;
btnFax = &quot; CHECKED &quot;
btnMail = &quot;&quot;
Else
btnOnline = &quot;&quot;
btnFax = &quot;&quot;
btnMail = &quot; CHECKED &quot;
End If

End If



<FORM NAME=&quot;Payment&quot; METHOD=&quot;Post&quot; ACTION=&quot;Payment.asp&quot;>
<TABLE ALIGN=CENTER>
<TR>
<TD><INPUT TYPE=&quot;radio&quot; id=credit1 NAME=&quot;IsCredit&quot; Value=&quot;<%=btnOnline%>&quot;><Strong>Order by Credit Card Online</Strong></TD>
</TR>
<TR>
<TD><INPUT TYPE=&quot;radio&quot; id=credit2 NAME=&quot;IsCredit&quot; Value=&quot;<%=btnFax%>&quot;><Strong>Order by Credit Card Using FAX</Strong></TD>
</TR>
<TR>
<TD><INPUT TYPE=&quot;radio&quot; id=credit3 NAME=&quot;IsCredit&quot; VALUE=&quot;<%=btnMail%>&quot;><Strong>Order by Credit Card through Postal Mail</Strong></TD>
</TR>
</TABLE>
<TABLE ALIGN=CENTER>
<TR>
<TD><INPUT TYPE=&quot;submit&quot; NAME=&quot;blnCreditCard&quot; VALUE=&quot;Submit&quot;></TD>
</TR>

</TABLE>
</FORM>
 
Hi xue !
The radio button if checked the code for it is

><INPUT TYPE=&quot;radio&quot; id=credit3 NAME=&quot;IsCredit&quot; VALUE=&quot;<%=%>% checked>

the value does not change
if checked it returns the value
if not checked it does not return a value

Regards Unicorn11
abhishek@tripmedia.com

[red]Luck is not chance, it's toil; fortune's expensive
smile is earned.[red]
 
yes, i got it. now I check which one is checked and give <%= %> = &quot;checked&quot;.

<TR>
<TD><INPUT TYPE=&quot;radio&quot; id=credit1 NAME=&quot;IsCredit&quot; Value=&quot;byonline&quot;<%=ifcheckonline%>><Strong>Order by Credit Card Online</Strong></TD>
</TR>
<TR>
<TD><INPUT TYPE=&quot;radio&quot; id=credit2 NAME=&quot;IsCredit&quot; Value=&quot;byfax&quot;<%=ifcheckfax%>><Strong>Order by Credit Card Using FAX</Strong></TD>
</TR>
<TR>
<TD><INPUT TYPE=&quot;radio&quot; id=credit3 NAME=&quot;IsCredit&quot; VALUE=&quot;bymail&quot;<%=ifcheckmail%>><Strong>Order by Credit Card through Postal Mail</Strong></TD>
</TR>

thank you very much, this is very helpful.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top