Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

OnChange Select Menu

 
Terrence Thurber
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm new to JavaScript and can't seem to find the solution to this problem anywhere. I'm making a user login manager for a gaming site I use. I Base include the site to do the actual POST form, but here is my problem.
I want to be able to select a Name from a drop down menu, and have it put the corresponding email in one text input field and the pass in the other. If possible, executing the post would be fantastic.
Terrence
 
jyothsna kumari
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if i understood your problem correctly,you can do something like this.
for the dropdown menu call a function whenever user selects a name like this
<select name="s1" onchange="dothis();>
and in the dothis function set the value you want in the input field,
something like this
<script language="javascript">
function dothis()
{
document.formname.textfieldname.value="your value";
}
</script>
jyothsna
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can execute the form by
document.formname.submit();
 
Terrence Thurber
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Awesome, now I can change the value, but how do i set the users and their individual options?
Also, the doc submint didnt work for me.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
where is the user information coming from.....
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic