Jump to content

please help...


TigaFan09
 Share

Recommended Posts

I am trying to make it easier to comment people on Myspace. The way I'm trying to set it up, selecting a name from a drop down menu will determine who I am sending the comment to. I'm having trouble setting the javascript up to change a value in the html when I select a different name in the drop-down menu.This is my html:

<html><body><script type="text/javascript" src="who.js"></script><form name="whoform"><select name="whodd" onchange="ChangeFriend()"><option value="me">me<option value="lucas">Lucas<option value="emily">Emily<option value="madeline">Madeline<option value="sydney">Sydney</select></form><br><br><br><form name="commentbox" method="post" action="http://comments.myspace.com/index.cfm?fuseaction=user.ConfirmComment"><input name="friendID" id="friendID" value="" type="hidden"><textarea name="f_comments" style="width: 250px; height: 150px; background-color: 000000; color: FFFFFF; font-family: comic sans ms; font-size: 12px; border: 2px dashed 2288EE; "></textarea><br /><input type="submit" value="Comment" /></form></body></html>
The bit that needs to be changed is underlined.This is my java script:
function ChangeFriend(){ if (document.whoform.whodd.value == "me") { changePropById('friendID','value','50874315'); } if (document.whoform.whodd.value == "lucas") { changePropById('friendID','value','61124154'); } if (document.whoform.whodd.value == "emily") { changePropById('friendID','value','46932298'); } if (document.whoform.whodd.value == "madeline") { changePropById('friendID','value','32584992'); } if (document.whoform.whodd.value == "sydney") { changePropById('friendID','value','47541037'); }}
I hope I explained what I am trying to do well enough, if not just ask.THANKS!
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...