在html中查询字符串

编程入门 行业动态 更新时间:2024-10-27 09:39:53
本文介绍了在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="www.w3/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中查询字符串

本文发布于:2023-10-22 08:44:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1517017.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字符串   html

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!