Solved

problem getting a select tag value

Posted on 2013-05-10
3
192 Views
Last Modified: 2013-05-10
i got the answer to this question: the question

in the same table i have a select menu with its option:
<select name="prod_opt" class="thetype">
<option value="+">+</option>
<option selected="selected" value="-">-</option>
</select>

Open in new window


now i need to get the selected values.

so according to the answer i got i tried this:
                    $('select.thetytpe', 'div.optvalis > table.optiontable').each(function() {
                       
                        optvaltype +=  $(this).val();
                        alert(optvaltype);
                    });

Open in new window


but i do not get anithing, even not an error.

any idea?
0
Comment
Question by:derrida
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
stergium earned 500 total points
ID: 39154676
Hello
did you tried getting the $(this).text() or $(this).html() ?
Actually doing this
$('select.thetype').val() you get the selected value. By the way you have a typo on your selection $('select.thetytpe', instead of $('select.thetype',

hope that helps
0
 
LVL 1

Author Closing Comment

by:derrida
ID: 39154691
what an idiot i am, it was the typo
0
 
LVL 13

Expert Comment

by:stergium
ID: 39154692
dont worry. many of us (including me) have spended hours on a missed character..
Glad that you worked it out.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Hi all! Recently there was EE question and the person wanted to have a multi-column textbox <div> selection, so as a first step to answer I provided a link but that was not complete with JavaScript selection, but had a good style sheet. So as a ques…
Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now