Solved

Jquery

Posted on 2015-02-17
2
102 Views
Last Modified: 2015-02-17
Hi Guys,

I have some jquery code in mvc application:

$('#po_type').change(function () {
if ($(this).val() == 3) {
var chx = $('#Vendor_to option:selected').val() == 14;
$('#Vendor_to').val() == chx;
}
 });              

Open in new window


what I would like to do is when I check "po_type" dropdown to 3 so the dropdownlist "vendor_to" change to vendor id to number 14 or to the vendor name. whatever work its k.


please help.
0
Comment
Question by:Moti Mashiah
2 Comments
 
LVL 44

Accepted Solution

by:
Rainer Jeschor earned 500 total points
ID: 40615270
Hi,
this should work:
    $('#po_type').change(function () {
        if ($(this).val() == 3) {
            $('#Vendor_to').val("14");
        }
     });     

Open in new window

Sample:
http://jsfiddle.net/EE_RainerJ/fd6tp4f2/

HTH
Rainer
0
 
LVL 1

Author Closing Comment

by:Moti Mashiah
ID: 40615297
SOlved
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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)
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

867 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

15 Experts available now in Live!

Get 1:1 Help Now