当用户在选择字段中选择其他选项时,显示其他文本字段 [英] display other text field when user selects other option in selection field

查看:104
本文介绍了当用户在选择字段中选择其他选项时,显示其他文本字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

[HTML]< html>

///


这里的脚本是什么:

- >当脚本运行时,不显示所有输入文本字段仅显示选择字段。

- >当用户为该机构选择其他值时,此字段显示不显示度数文本字段

- >当用户在度数的选择字段中选择其他值然后显示文本字段时,反之亦然

////

< bodly>

< table>

< tr>

< td> select Institute:< / td>

< ; td>

< select name =''inst''id =''inst''>

< option value =''select''> select< / option>

< option value =''a''> a< / option>

< option value =''b''> b< / option>

< option value =''other''> other< / option>

< / select>

< input type =''text''name ='' odeg''id =''odeg''>

< / td>

< / tr>

< tr>

< td>选择度:< / td>

< td>

< select name =''deg'' id =''deg''>

< option value =''select''> select< / option>

< option value =''x ''> x< / option>

< option value =''y''> y< / option>

< option value =''other ''>其他< /选项>

< / select>

< input type =''text''name =''odeg''id =' 'odeg''>

< / td>

< / tr>

< / table>

< / body>

< / html> [/ HTML]


///////////// ///

请完全关注我的问题并解决问题。我将非常感谢所有论坛用户。


谢谢和问候

dkyadav80

[HTML]<html>
///

here what shoud be java script for:
->when script run then not display all input text field only display selection field.
->when user select other value for institute only this field display not display degree text field
->when user select other value in the selection field for degree then text field display and wise versa
////
<bodly>
<table>
<tr>
<td>select Institute:</td>
<td>
<select name=''inst'' id=''inst''>
<option value=''select''>select</option>
<option value=''a''>a</option>
<option value=''b''>b</option>
<option value=''other''>other</option>
</select>
<input type=''text'' name=''odeg'' id=''odeg''>
</td>
</tr>
<tr>
<td>select Degree:</td>
<td>
<select name=''deg'' id=''deg''>
<option value=''select''>select</option>
<option value=''x''>x</option>
<option value=''y''>y</option>
<option value=''other''>other</option>
</select>
<input type=''text'' name=''odeg'' id=''odeg''>
</td>
</tr>
</table>
</body>
</html>[/HTML]

////////////////
pls care fully seee my problem and solve. i will be higly oblige to all of u forum users.

Thanks and Regards
dkyadav80

推荐答案

您的需求没有单线解决方案。我会说你实际上需要先看几个教程。如果你发现任何困难,你可以再次回来。


以下链接可以帮助你。
HTML Dom样式对象
CSS


查看两个链接中的显示属性。

那里在你的情况下,与AJAX无关,除非你在点击第一个选择元素后必须从服务器获取下拉列表。
There''s not a one-line solution to your need. I would say you actually need to have a look at few tutorials first. Then you can come back again if you find any difficulty.

Here are the links which may help you.
HTML Dom Style Object
CSS

Check out the display property in both the links.
And there''s nothing to do with AJAX in your case, unless you have to fetch the list of the drop downs from the server after clicking on the first select element.



这是我的javascript代码:

//////////////////
Hi,
this is my javascript code:
//////////////////
展开 | 选择 | Wrap | 行号





请帮帮我;


i想要在forst time脚本运行的时候,所有其他文本字段都不应该显示,当选择其他文本字段显示时。我已经编写了这段代码,当我在第一个选择字段中选择第一个选择其他字段时显示所有其他字段但这是错误的。当我选择一个然后另一个字段显示时,当选择欧姆文本字段然后显示其他文本字段。当选择其他的其他值时,则应隐藏其他文本字段。下面是我的代码:




这是我的javascript代码:

///////// /////////
Hi,

pls help me;

i wanna when forst time script run then all other text field should not be display and when select other then other text field display. i have written code this code when i
select first select other from first selection field this is displaying all other field but this is wrong. when i select one then one other field display and when slect ohter text field then display other text field. and when select other value rest of ''other'' then other text field should be hide. below is my code:

Hi,
this is my javascript code:
//////////////////
展开 | 选择 | Wrap | 行号


这篇关于当用户在选择字段中选择其他选项时,显示其他文本字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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