Solved

How do I set the dropdownlist with a value of custom to the current selected item in jquery?

Posted on 2013-01-21
3
326 Views
Last Modified: 2013-02-06
How do I set the dropdownlist with a value of custom to the current selected item in jquery? code attached

 <select class="dropDown optional-degree" data-val="true" data-val-number="The field Cost Tools must be a number." data-val-required="The Cost Tools field is required." id="AttackSequenceEditModels_CostToolsId" name="AttackSequenceEditModels.CostToolsId"><option value=""></option><option data-score="0.2" value="1">Low</option><option data-score="0.6" value="2">Medium</option><option data-score="0.9" value="3">High</option><option data-score="0" value="4">Custom</option></select>
0
Comment
Question by:cbrune
[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
3 Comments
 
LVL 22

Expert Comment

by:Mrunal
ID: 38805066
Hi cbrune, Can you pl explain more what exactly you want to achieve?

Mean while you can look at this example. hope this helps you.

http://jsfiddle.net/gTCt4/
0
 

Author Comment

by:cbrune
ID: 38805935
i want to have a button on the page that sets the dropdown to custom
0
 
LVL 22

Accepted Solution

by:
Mrunal earned 500 total points
ID: 38813308
Check this:

http://jsfiddle.net/gTCt4/1/

This sets dropdown list value to custom on button click.
0

Featured Post

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

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

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
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