CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   JavaScript frameworks (http://www.codingforums.com/forumdisplay.php?f=62)
-   -   jQuery : how to parse selected value to another text box (http://www.codingforums.com/showthread.php?t=283393)

ebookz 12-02-2012 11:16 AM

jQuery : how to parse selected value to another text box
 
here is my iQuery code :
Code:

<html>
<head>
<title>Selects jQuery parsed..</title>
<script type="text/javascript" src="jquery-1.8.3.min.js"></script>
<script type="text/javascript">
$(document).ready(function(e) {

$("#no_exam").change(function(){
var textval = $(":selected",this).val();
$('input[name=std_marks]').val(textval);
result_form.std_marks.disabled=(!textval)?false:true; // if select a value , text feild is readonly

})

});</script>
</head>

<body>
Selection :<select name="no_exam" id="no_exam">
<option value="" selected="selected">===select option===</option>
<option value="A+">100-75</option>
<option value="B+">50-74</option>
<option value="C+">0-49</option>
<option value="AB">AB</option>
<option value="NE">NE</option>
<option value="MC">MC</option>
</select></br>
Selected value :<input type="text" name="std_marks" id="std_marks"/>
</body>
</html>

this code is works perfectly for me...But I want to change this code ..

my problem is here this selection group have two categories...one is marks & other is absent..

* Marks category:100-75,50-74,0-49

* Absent category :AB,NE,MC

Here when I select a option then it's value is parse to the Selected value box..How can I edit this code to parse values only select Absent category options....(When I select a Marks category option ,do not parse a its value )

ebookz 12-02-2012 11:16 AM

http://jsfiddle.net/dontspeak/2zfdq/4/
U can view the output of above my code...:confused::confused:


All times are GMT +1. The time now is 10:13 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.