Forum Moderators: open

Message Too Old, No Replies

help with a form

hard to discribe in a few words

         

floz

4:20 pm on Feb 24, 2005 (gmt 0)

10+ Year Member



hi there!

i would like to make a search field where you can select the "searchengine" with a drop-down-box.

at the moment i have 2 seperate fields.

here's the 1st of theses "engines":


<form action='http://univis.uni-magdeburg.de/form' method='post'>
<input type='text' name='what' size='35' class='text' />
<input type='hidden' name='defaultto' value='anew/tel_search:DEFAULT' />
<input type='submit' name='done-anew/tel_search:search' value='suche' class='button' />
</form>

the other one goes quite similar:


<form action='http://univis.uni-magdeburg.de/form' method='post'>
<input type='text' name='what' size='35' class='text' />
<input type='hidden' name='defaultto' value='anew/pande_search:DEFAULT' />
<input type='submit' name='done-anew/pande_search:search' value='suche' class='button' />
</form>

as you can see what differs between the two of the is the hidden defaultto und the submit-button

can you plz tell me how i can combine those to forms to one single form but with a drop-down-box for one of the two?

i'm sure it's just a tine bit of javascript.....

THX A LOT! YOUR HELP IS VERY APPRECIATED

orion_rus

4:48 pm on Feb 24, 2005 (gmt 0)

10+ Year Member



instead ot this
<input type='hidden' name='defaultto' value='anew/tel_search:DEFAULT' />
and this
<input type='hidden' name='defaultto' value='anew/pande_search:DEFAULT' />
place in a 1 form this
Type of search: <select name='defaultto'>
<option value='anew/tel_search:DEFAULT'>Tel</option>
<option value='anew/pande_search:DEFAULT'>Pande</option>
</select>
Good luck to you

floz

5:04 pm on Feb 24, 2005 (gmt 0)

10+ Year Member



thanks for your answer.

well i tried this already, but the problem is (that's the reason i'm posting here) that there are *two* things changing between the forms. via select/option i can only change the value to 'defaultto'.

if you look closely, the name='' for the submit-buttons also changes :(

that's exactly my the problem i have. thought i need a little javascript, which changes the name='' of the button according to the choice made in the option/selection-input..........

orion_rus

7:27 pm on Feb 24, 2005 (gmt 0)

10+ Year Member



u absoulutely did't need to name a submit button. you can make it on a server side if selectname=1 submit=1 if selectname=2 submit=2 that's all you didn't need it at all.