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

Q

Quasimido CSS

<form action="http://www.mmmm.org/cgi-bin/search" 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>
</select>
</form>

i'd like
to convert input name="yyyyyy" to a select name="yyyyyyy" (or whatever that can have
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>
</select>

except it would actually look like whatever would work :)

unless this is impossible? or possible only with script?

------
googling the likes of
http://groups.google.com/groups?q=select+name+options+~tied+form+html
associated multiple two-options
gave optgroup or less likely answers

tia...
 
S

Safalra

Quasimido said:
i'd like
to convert input name="yyyyyy" to a select name="yyyyyyy" (or whatever that can have
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)

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.
 
Q

Quasimido CSS

You can hide a select element using CSS (display:none;), but obviously
that depends on whether the UA supports CSS.

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

It might be a better idea
to tell us why exactly you want to do this, and then we could propose
better solutions.

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 servers)

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 option
values for each zzzzzz no matter the page, but their cgi-whatever groups a bucnh of
zzzzz values with each yyyyyy input.

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

eg, either:
mixnmatch causes weirdness.
www.site.com/search?yyyyyy=sheep&zzzzzz=gills
doesn't return any search results
or
when i chose the yyyyyy="0" value (it exists normally when zzzzzz is also
unspecified)
www.site.com/search?yyyyyy=0&zzzzzz=gills
it shows good search results, but the page hides the select option to choose a different
zzzzzz

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 pulldown,
and have yyyyyy=fish be 'automatically' associated or tied to my zzzzzz select, before
the form submits to the site:
www.site.com/search?yyyyyy=fish&zzzzzz=gills
choose fins:
www.site.com/search?yyyyyy=fish&zzzzzz=fins
choose baaaaahh:
www.site.com/search?yyyyyy=sheep&zzzzzz=baaaaahh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top