Hi,
I basically have a form that passes form element variables. Simple enough, but, one of them is a select box. The options inside are more or less child/parent related (nodes, if you will) and can branch many many levels deep.
I can generate these fine, for example:
My Cat -> this value is "6" (basically, cat id 6)
- My Sub Cat (basically, cat id 7)
- My Sub Cat 2 (basically, cat id 8)
- - Child sub Cat Of above (basically, cat id 9) <-- here is a problem. I need to pass the parent also, like this:
<option value="8&view=9">- - Child of cat of above
Basically, if the option is a child of a parent I need to pass the standard cat id, but also the child id. This is easily done, like here (this is an actual copy/paste of the ids/names so if they don't make sense don't mind them):
<option value='14'>Amulets & Rings
<option value='14&view=87'>- Rings
<option value='14&view=96'>-- Bul-Kathos
<option value='14&view=102'>-- Carrion Wind
<option value='14&view=101'>-- Dwarf Star
<option value='14&view=100'>-- Nagel Ring
<option value='14&view=99'>-- Natures Peace
<option value='14&view=98'>-- Raven Frost
<option value='14&view=95'>-- Stone of Jordan
<option value='14&view=97'>-- Wisp Projector
<option value='14&view=86'>- Amulets
<option value='14&view=93'>-- Atmas Scarab
<option value='14&view=91'>-- Highlords Wrath
<option value='14&view=88'>-- Maras
<option value='14&view=90'>-- Metalgrid
<option value='14&view=89'>-- Seraphs Hymn
<option value='14&view=92'>-- The Cats Eye
<option value='14&view=94'>-- The Rising Sun
<option value='9'>Annihilus
<option value='9&view=60'>- Unidentifed
Now, passing root parents (ie, Amulets & Rings, cat #14) works fine as you'd expect. I was under the assumption I could pass and amp and another value and it would set too. I guess not, the output is actually:
/browse.php?rid=1&type=1&cat=14%26view%3D100&mode=image&display=asc&show=20&page=1
My ideal result is...
/browse.php?rid=1&type=1&cat=14&view=100&mode=image&display=asc&show=20&page=1
Is this possible to do in pure PHP without using a hidden form element? I know that'd probably be the simplest way, but I know this works fine in pure JS (ie, using an onClick and grabbing the index array of the select options. I tried also using the & and such but to no avail; yeilding the same result.
Thanks