Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > associate a hidden input to (chosen) select option in form?

Reply
Thread Tools

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

 
 
Quasimido CSS
Guest
Posts: n/a
 
      11-07-2005
<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=se...tied+form+html
associated multiple two-options
gave optgroup or less likely answers

tia...
 
Reply With Quote
 
 
 
 
Safalra
Guest
Posts: n/a
 
      11-07-2005
Quasimido CSS wrote:
> 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.

--
Safalra (Stephen Morley)
http://www.safalra.com/hypertext/

 
Reply With Quote
 
 
 
 
Quasimido CSS
Guest
Posts: n/a
 
      11-07-2005
"Safalra" <> in news:1131381265.601069.118530
@f14g2000cwb.googlegroups.com:

> Quasimido CSS wrote:
>> 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.


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

> 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




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing select option removes entire select Nick Spacek Javascript 1 06-21-2006 04:45 PM
select option value into a hidden variable..... graniteraju@gmail.com Java 0 02-28-2006 12:36 AM
select option as a hidden variable... graniteraju@gmail.com HTML 0 02-28-2006 12:31 AM
modify the default option in a select changing another select WebRaster Javascript 1 10-26-2005 10:36 AM
Selection from One SELECT changes selected option of another SELECT? J. Hall HTML 2 04-21-2004 05:36 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57