views:

245

answers:

2

I have 2 very simple pages, an HTML page and a classic ASP page .. the html page has a form which calls (and sends) the data to the ASP form (which then prints out the data)

The problem is I'm not getting the value of the radio button, I'm simply just getting "on".

Here is the html:

<form action="form.asp" method="post">
    <strong>Gender:</strong>
    <input type="radio" value"male" name="gender">Man
    <input type="radio" value"female" name="gender">Woman<p></p>
    <strong>Size:</strong>
    <input type="text" width="20" name="size" size="4"><p></p>
    <strong>Color:</strong>
    <select size="1" name="color">
        <option>blue</option>
        <option>green</option>
        <option>black</option>
    </select><p></p>
    <input type="submit" value="Send Order">
</form>

and here is the ASP

<%
Dim strgen, strsize, strcol
strgen = Request.form("gender")
intsize = Request.form("size")
strcol = Request.form("color")
Response.write "Your gender: " & strgen & "<br />"
Response.write "Your size: " & intsize & "<br />"
Response.write "The color you ordered: " & strcol & "<br />"

%>

Like I said, all I'm getting for "strgen" is "on" ...

+2  A: 

There's typos in your code, missing equals sign.

value"male"

should be

value="male"

Because the value was ignored it was returning the default value of "on"

AUSteve
Please use an html validator (search for them via google) before posting such questions. It will save you a lot of time.
Edelcom
A: 

Try using an html validator as www.htmlvalidator.com. This site offers a free one which is good (I'm using the professional version myself).

This will find such types immediatly (and will save you countless hours of searching).

Edelcom