开发者

Can HTML Select Tag work with Hidden Text Input?

I am not sure if Select Tag can work with Hidden Text Input 开发者_StackOverflowlike this:

<SELECT NAME="Testing">  
  <OPTION VALUE="1"> One </option> 
  <input type="hidden" value="hello" name="Testing">
  <OPTION VALUE="2"> Two </option>
  <input type="hidden" value="world" name="Testing">   
</SELECT>

Any ideas?


That won't work, but this will:

<form>
<input type="hidden" value="hello" name="Testing">
<input type="hidden" value="world" name="Testing">   
<SELECT NAME="Testing">  
  <OPTION VALUE="1"> One </option> 
  <OPTION VALUE="2"> Two </option>
</SELECT>
</form>

Now judging from your code, it looks like you want Testing=hello if the first option is selected and Testing=world if the second option is selected. In that case, do it like this:

<SELECT NAME="Testing">  
  <OPTION VALUE="hello"> One </option> 
  <OPTION VALUE="world"> Two </option>
</SELECT>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜