• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
Sheriffs:
  • Devaka Cooray
  • paul wheaton
  • Mark Herschberg
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
  • Jj Roberts
Bartenders:
  • Carey Brown
  • salvin francis
  • Piet Souris

urgent...select ....option... doubt

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,
i am populating my combo box, that i was created using <select>
and <option> tags, with some values.I have one requrement like this . On selecting one particular value from the combo box , i
have to print that value on the browser.
How can i achieve this . Examples are also welcome.
My sample code is :
<html>
<title> Dynamic values </title>
<head>
</head>

<body>
<br>
<br>
<select name="name" >
<% int a=10;
int b=20;
for(int y=a;y<b;y++) { %>
<option)><%=y%></option>
<% } %>
</select>
</body>
</html>
bye
thanx in advance ,
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you only have one value that needs to trigger a function and your values are being created dynamically by server-side code, then your server-side code will have to generate some javascript for you, too. In your <option> tag, create an event handler like this:

Then you can have your server-side code generate myfunc() to include a test for your particurlar value.
 
and POOF! You're gone! But look, this tiny ad is still here:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic