如何在html select选项中打开另一个窗口 [英] how to open another window in html select option

查看:301
本文介绍了如何在html select选项中打开另一个窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在执行一项任务,需要在HTML页面中创建一个下拉列表,并且正在使用ASP.Net 4.0.
以下是我的代码,用于使用所需的值创建和填充下拉列表.

 <  选择 > ; 
<  选项 >  <  /option  > 
<  选项 > 白俄罗斯语<  /option  > 
<  选项 > 保加利亚语<  /option  > 
<  选项 > 德语<  /option  > 
<  选项 > 英语<  /option  > 
<  /select  >  



现在,我想在用户单击列表中的任何项目时打开另一个表单,并且我必须根据用户选择的项目在新表单中重新提供该项目.

请提出我该如何做到这一点.任何链接/代码都将是首选.

在此先感谢.

解决方案

尝试
例如:

 <  选择 > ; 
<  选项 >  <  /option  > 
<  选项    ="   Window.Open('MyPage.aspx','_ Blank', 'widht = 500px,height = 500px')" <  /option  > 
<  选项    ="   Window.Open('MyPage.aspx','_ Blank', 'widht = 500px,height = 500px')" <  /option  > 
<  选项    ="   Window.Open('MyPage.aspx','_ Blank', 'widht = 500px,height = 500px')" <  /option  > 
<  选项    ="   Window.Open('MyPage.aspx','_ Blank', 'widht = 500px,height = 500px')" <  /option  > 
<  /select  >  


Hello All,

I am working on one task where I need to create one drop down list in HTML Page and I am using ASP.Net 4.0.
Below is my code to create and populate drop down list with required values.

<select>
<option></option>
<option>Belarusian</option>
<option>bulgarian</option>
<option>German</option>
<option>English</option>
</select>



Now I want to open another form when user click on any item in the list and I have to rendor the item in the new form based on item selected by user.

Please suggest How can I accomplish this. Any link /Code will be preferred.

Thanks in Advance.

Try How To Open a Web Page In a New Browser ASP.NET?[^].


use onclick event in option tag and call javascript function window.open("page name","_blank/_self","properties like height,width etc")

example:

<select>
<option></option>
<option onClick="Window.Open('MyPage.aspx','_Blank','widht=500px,height=500px')">Belarusian</option>
<option onClick="Window.Open('MyPage.aspx','_Blank','widht=500px,height=500px')">bulgarian</option>
<option onClick="Window.Open('MyPage.aspx','_Blank','widht=500px,height=500px')">German</option>
<option onClick="Window.Open('MyPage.aspx','_Blank','widht=500px,height=500px')">English</option>
</select>


这篇关于如何在html select选项中打开另一个窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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