Click here to Skip to main content
15,884,472 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hiii alll,

in a html page with submit button and select control .
i want to redirect to an aspx page with the value the select control selects .

HTML
<input type="submit" name="Submit" value="search" onclick="Search.aspx?PropertyType="+........ />
<select id="cmb_type" style="width:100px;">
<option value="type">type</option>
</select>

So, Any help....

Thanks
Posted
Updated 20-Sep-11 3:32am
v2

on click of the button, you can call a javascript function which will read the dropdown value and construct a action url, submit the form as well.
 
Share this answer
 
Comments
moon2011 20-Sep-11 9:41am    
thanks for your help, but i hope for another soulation without using javascript.
Hi,

Try my code for your requirement.

HTML
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script language ="javascript" >
        function f2() {
     
            location.href = "Search.aspx?PropertyType=" + document.getElementById("cmb_type").value;
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <input type="button"  id="btn" value="search" onclick="f2()"/>
<select id="cmb_type" style="width:100px;">
<option value="type">type</option>
<option value ="sgh">subtype</option>
</select>

    </div>
    </form>
</body>
</html>


input type must be button not submit k
the javascript method invoke only for button type only

All the best
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900