PDA

View Full Version : radio button checked value not complying


hyefive
04-05-2004, 07:22 PM
Hi,

I have an .asp that uses the (much scaled-down) following pretext to determine when to apply a "checked" value to a couple radio buttons:

<%
PROP_TYPE = "RES"
If Request.QueryString("PROP_TYPE") <> "" Then
PROP_TYPE = Request.QueryString("PROP_TYPE")
End If
%>

<html>

<table...><tr>
<td>Property Type*:</td>
<td><input type="RADIO" name="PROP_TYPE" value="RES"<% If PROP_TYPE = "RES" Then Response.Write " checked" End If %>>Residential
<br>
<input type="RADIO" name="PROP_TYPE" value="INC"<% If PROP_TYPE = "INC" Then Response.Write " checked" End If %>>Multi-Residential Income</td>
</tr><.../table>

</html>


This works in IE, with the appropriate button being checked however the user arrives to the page, but not in NETSCAPE (7.1, at least). The problem in Netscape is not upon the first time they arrive (works fine then), but on subsequent arrivals via the BACK button- at which time neither of the two radio buttons are checked.

Funny thing is, the page is evaluating the PROP_TYPE = "RES" directive, because VIEW SOURCE shows "checked" in the correct radio box, and later on down the page it's succesful with an If-Then that displays material accordingly.

Any ideas on what's happening here?

Greatly appreciated,
m

redhead
04-05-2004, 09:36 PM
I don't know much about ASP, but might be able to give you a hand with the HTML it is generating. Try making it write checked="checked" rather than just checked... That way it will validate, and hopefully work too :)

Feyd
04-05-2004, 10:04 PM
checked="checked" will validate if you are using XHTML, though I don't see anywhere where you are stating if this is traditional HTML 4 or XHTML. It could easily be a caching issue, especially if this redirecting you allude to is done through a POST.

redhead
04-05-2004, 10:37 PM
My mistake...

hyefive
04-05-2004, 11:10 PM
Thanks for the replies.

Feyd, I don't follow your comment about the "redirecting you allude to is done throught a POST."

I suspect it is a caching issue, but still don't know what approach to take to rectify the problem.

Any ideas?

Thanks again,
monquatch