 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
person211
Joined: 29 Dec 2004 Posts: 1
|
Posted: Wed Dec 29, 2004 12:17 pm HELP WITH HTML!!!! |
|
|
|
ok i need help...u kno how theres like a drop down menu and options on a site and ur supposed to fill in info about urself..for example the question cud be eye colour: and the options are brown, black, bule, green............... buh ur eye colour is like hazel...wahs the html code for choosing a diff option den already there..lol trust me there is one i've done it before i just forgot wat it is..please helpppp  |
|
Adeil

Joined: 07 Dec 2004 Posts: 52 Location: USA
|
Posted: Wed Dec 29, 2004 2:19 pm |
|
|
|
hmmm...i think that you would use javascript for that...like, if you were filling it out, and the dropdown menu was in the first form, you would put something in the address bar that looks something like this...
| Code: |
| javascript:void(document.form[0].value="blabla") |
that will change the value of the form, you would just need to somehow target the dropdown menu that is in the form...
that works for changing the value of the form, but maybe if the dropdown menu had the name of eye then you would have to use that name to target it, with the javascript hehe. |
|
Corey Bryant Site Admin

Joined: 15 May 2004 Posts: 8748 Location: Castle Pines North, CO USA
|
Posted: Wed Dec 29, 2004 6:07 pm |
|
|
|
|
I think you are looking for something like:
| Code: |
<html>
<head>
<script>
function checkAdd(theSel){
if(theSel.selectedIndex==(theSel.options.length-1)){
newOpt=prompt("Enter new Option","")
if(newOpt>""){
theSel.options[theSel.selectedIndex].text=newOpt;
theSel.options[theSel.options.length]=new Option("Other");
}
}
}
</script>
</head>
<body>
<form>
<select onChange="checkAdd(this)">
<option>A</option>
<option>B</option>
<option>C</option>
<option>Other</option>
</select>
</form>
</body>
</html> |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
|
 |
|
|
|
|
|
|
|