codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Form SELECT auto post or get of selection  alex243 at 18:51 on Monday, November 13, 2006
 

Trying to figure out how to automatically send form data when a option from a SELECT drop down menu is clicked on. I don't want to press a button to submit the data. Any help is greatly appreciated!!!

  Re: Form SELECT auto post or get of selection  haripriya amaresan at 05:57 on Thursday, December 14, 2006
 

Hi,

Just use onchange event on combobox selection. This will get activated when you change any option in the combobox.

Sample Script:
------------------------------
<html>
<head>
</head>
<script>

function comboSelected(selectedVal){
alert("selectedVal::"+selectedVal.value);
}

</script>

<body>
<form>
<select name="cars" onchange='javascript=comboSelected(this);'>
<option value="null"></option>
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="fiat">Fiat</option>
<option value="audi">Audi</option>
</select>
</form>
</body>
</html>

-----------------------------

have a look at this.



  Re: Form SELECT auto post or get of selection  haripriya amaresan at 05:57 on Thursday, December 14, 2006
 

Hi,

Just use onchange event on combobox selection. This will get activated when you change any option in the combobox.

Sample Script:
------------------------------
<html>
<head>
</head>
<script>

function comboSelected(selectedVal){
alert("selectedVal::"+selectedVal.value);
}

</script>

<body>
<form>
<select name="cars" onchange='javascript=comboSelected(this);'>
<option value="null"></option>
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="fiat">Fiat</option>
<option value="audi">Audi</option>
</select>
</form>
</body>
</html>

-----------------------------

have a look at this.



<Added>

Run this program and get ur code.








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  Re: Problem with concatenation
•  how to genrates the crystal report by sending a id at runtime
•  help me
•  pls help me with this..
•  Re: Security - Code verify
•  Job @ EarlySail
•  Job @ EarlySail (perl)
•  IPC problem
•  Re: import contacts of msn/yahoo


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2007