associate a hidden input to (chosen) select option in form?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
<form action=" " method="get">
<input name="yyyyyy" value="1" type="hidden">
<input name="query" size="50" value="">
<select name="zzzzzz">
<option value="888">YOU-WANT-THIS</option>
<option value="899" selected="selected">OR-KEEP-THIS</option>
<option value="999">OR-CHOOSE-THIS</option>

i'd like
to convert input name="yyyyyy" to a select name="yyyyyyy" (or whatever that can
more than one value assigned) that is
1        also chosen when user chooses the select name="zzzzzz" option.
2        still hidden (this isn't terribly important, though)

so this
<input name="yyyyyy" value="1" type="hidden">

would instead look something like
<select name="yyyyyy">
<option value="1">1 but you can't see this</option>
<option value="2">2 but you can't see this</option>
<option value="3">3 but you can't see this</option>

except it would actually look like whatever would work :-)

unless this is impossible? or possible only with script?

googling the likes of
associated multiple two-options
gave optgroup or less likely answers


Re: associate a hidden input to (chosen) select option in form?

Quasimido CSS wrote:
Quoted text here. Click to load it

You can hide a select element using CSS (display:none;), but obviously
that depends on whether the UA supports CSS. It might be a better idea
to tell us why exactly you want to do this, and then we could propose
better solutions.

Safalra (Stephen Morley) /

Re: associate a hidden input to (chosen) select option in form?

Quoted text here. Click to load it

there's a simple solution to the 2nd part, thanks

inspired me to try  type="hidden" in <select.. > and in <option ..>
but as  expected, (because it wouldnt make sense to hide a choice) that had no

Quoted text here. Click to load it

end goal?
i have copies of various site forms jammed onto my browser homepage (since i'm
submitting to websites, i cannot change the cgi whatever on those websites

in the case of this site,
Essentially the visitor selects yyyyyy by going to that webpage.  yyyyyy has
only a few
values, and each value is found on only one webpage. the site use a unique
values for each zzzzzz no matter the page, but their cgi-whatever groups a bucnh
zzzzz values with each yyyyyy input.

when testing values in the url, i discovered that thier cgi-whatever ignores or
values of zzzzzz that aren't associated with the yyyyyy value in the url

eg, either:
mixnmatch causes weirdness.
doesn't return any search results
when i chose the yyyyyy="0"  value (it exists normally when zzzzzz is also
it shows good search results, but the page hides the select option to choose a

the goal of my html:
i use only a few zzzzzz.  so i'd like to put them in just one pulldown (select).
i'm trying
to avoid having to go to each page, just to change the change the value of
yyyyyy in
order to see my newly chosen zzzzzz.

in terms of the critter parts examples, I want to select zzzzzz=gills using the
and have yyyyyy=fish be 'automatically' associated or tied to my zzzzzz select,
the form submits to the site:
choose fins:
choose baaaaahh:

Site Timeline