HTML Tutorial


 /help/HTML Help Forum   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
HELP WITH HTML!!!!
Post new topic   Reply to topic    HTML Help Forum -> General HTML
View previous topic :: View next topic  
Author Message
person211



Joined: 29 Dec 2004
Posts: 1

PostPosted: Wed Dec 29, 2004 12:17 pm     HELP WITH HTML!!!! Reply with quote

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 Very Happy
Adeil



Joined: 07 Dec 2004
Posts: 52
Location: USA

PostPosted: Wed Dec 29, 2004 2:19 pm     Reply with quote

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

PostPosted: Wed Dec 29, 2004 6:07 pm     Reply with quote

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>
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum -> General HTML All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
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
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
DARFUR
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial