A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
Arduino in Action
this week in the
General Computing
forum!
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
JavaRanch
»
Java Forums
»
Engineering
»
HTML, CSS and JavaScript
Author
get the selected value of dropdown box when button is clicked in row
reddy raja
Greenhorn
Joined: Sep 21, 2009
Posts: 17
posted
May 23, 2010 13:05:38
0
Hi ,
Can anybody help me i want to know the value present in drop down box when a button is clicked in that row only.
i am not able to capture the clicked button they will have same attributes for EX:
function samplefun(){ var x=document.forms[0].sample.length; for(var i=0;i<x;i++){ if(document.forms[0].sample.selectedIndex){ alert("clicked"+i); } } } <form id="myform"> <table> <tr> <td><input type="button" name="sample" id="sample" onclick="samplefun()"/></td> <td> <select id="sel"> <option label="SELECT" selected="selected">--Select--</option> <option label="one">one</option> <option label="two">two</option> </select> </td> </tr> <tr> <td><input type="button" name="sample" id="sample" onclick="samplefun()"/></td> <td> <select id="sel"> <option label="SELECT" selected="selected">--Select--</option> <option label="one">one</option> <option label="two">two</option> </select> </td> </tr> </table>
can anyone help me
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56529
14
I like...
posted
May 23, 2010 13:12:05
0
Please
UseCodeTags
and indent your code properly. I will not read unformatted code.
[
Smart Questions
] [
JSP FAQ
] [
Books by Bear
] [
Bear's FrontMan
] [
About Bear
]
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12617
I like...
posted
May 23, 2010 14:02:58
0
To be fair, it was almost worth reading for "butfun".
I agree. Here's the link:
http://zeroturnaround.com/jrebel
- it saves me about five hours per week
subject: get the selected value of dropdown box when button is clicked in row
Similar Threads
Getting error
storing the added rows of table value in database from a jsp page
spaces while populating using s:iterator
Passing array values using Ajax & JSP
Struts 2 <s:submit action > and javascript help
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter