在html中查询字符串 [英] query string in html

查看:95
本文介绍了在html中查询字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hiii alll,

在带有提交按钮的html页面中,然后选择控件.
我想使用选择控件选择的值重定向到aspx页面.

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 .

<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

推荐答案

单击该按钮,您可以调用一个javascript函数,该函数将读取下拉列表值并构造一个操作网址,并提交表单.
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.




根据您的要求尝试我的代码.

Hi,

Try my code for your requirement.

<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>



输入类型必须为不提交按钮的按钮
javascript方法仅针对按钮类型调用

一切顺利



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

All the best


这篇关于在html中查询字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆