Passing hidden input fields in HTML Select option -


Does anyone know if & lt; Select & gt; It is possible to pass a hidden request parameter with in the HTML code & lt; Options & gt; element

For example, if the user has & lt; Option value = "foo" & gt; Foo & lt; / Option & gt; from a to & lt; Select & gt; List of options, can I somehow get a hidden value, as well as the "foo" value, and request parameters? Like & lt; Input type = "hidden" name = "x" value = "bar" /> I will be able to get the "foo" and "bar" requests when the user has the Foo option.

Thanks

Both prices are displayed in a selection list for the user and A value that is sent back to the server on the form. You can use some sort of delimiter in the value posted to send both values ​​back and then you can parse them at that time:

"myselectlist" & gt; & Lt; Option value = "foo; times" & gt; Foo & lt; / Options & gt; & Lt; Option value = "foo2 | times2" & gt; Foo2 & lt; / Options & gt; & Lt; / Select & gt;

But so far an ID value has to be returned, which one you want to select from a database and then use it to view other related items Are:

  & lt; Select ID = "myselectlist" & gt; & Lt; Option value = "123" & gt; Foo & lt; / Options & gt; & Lt; Option value = "124" & gt; Foo2 & lt; / Options & gt; & Lt; / Select & gt;  

Your database may look like this:

  id display value other data 123 foo time 124 foo2 times 2  

Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -