View Full Version : stupid drop down menu
02-26-2003, 12:12 PM
What I need must be quiet simple but I can't make it work.
I've got a text area and some buttons surrounding it. When you click on a button, "some text" is added to the textarea using the following script: (example for one button)
document.formname.textareaname.value=text + "my email is:";
What I'm trying to do now is to put a drop down menu with which you can add more "text" by selecting the options.
For example if you select "my country is" from the drop down menu, "my country is" is added to the textarea so that way you can write your country, in the final textarea would be:
bla bla bla bla bla my country is here or there bla bla bla
same if you select "my birthday is on the", "my favourite...", etc, etc, etc...
Thanks in advance.
02-26-2003, 06:30 PM
I have uploaded a file in which you can test what I mean if you want. Thanks.
02-26-2003, 06:38 PM
Im not entirely sure exactly what you want but this might be it:
<option value="my country is">Country</option>
<option value="my favourite is">Favourite</option>
This is the drop down list containing the various texts
Then this is the code that adds the right text to the area:
This adds the value of the selected option to the end of the message as opposed to a fixed text.
Hope this helps
02-26-2003, 07:01 PM
It seems logic what you say, but I made the changes and it isn't working yet.
<p align="center"><select name="list">
<option selected>Add detail</option>
<option value="My Country is ">Country</option>
<option value="My favourite pet is ">Favourite</option>
What am I doing wrong?
02-26-2003, 07:14 PM
I will go check that my code is correct and get back to you
02-26-2003, 07:26 PM
according to the previous code, this should work. Exactly what error codes are you receiving? else what is going wrong?
02-26-2003, 07:26 PM
thanks optimism_, I appreciate your taking the time.
02-26-2003, 07:28 PM
02-26-2003, 09:55 PM
Sorry man! I think we posted at the same time. No, I couldn't make it work. Check it out in the new attached file. We should get the same action by selecting an option of the drop-down menu than the one we get when we press the buttons. I don't have any clue.
02-26-2003, 10:10 PM
ps ive saved it as txt, just rename to .htm(l)
02-26-2003, 10:29 PM
¿?¿?¿? Anyway... It definitively works! I wouldn't have changed them to lower in my life. It is the first time I see that. Now I cannot understand why my pages look that good (because the code is usually an upper-lower-over_spaced nightmare...). Thanks a million Optimism_. Now I just have to find a use for all this.
02-26-2003, 10:31 PM
The other thing, now i think of it, was that there wasnt actually a function for the select box, so changing it wouldnt have done a thing, and also, because the code wasnt in a function, it was being called before the COMMENTS box was being created, thus an error about it not existing.
Anyway - glad it works :)
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.