Solved

Jquery

Posted on 2015-02-17
2
105 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
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…

726 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