Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Nov 2012
    Posts
    33
    Thanks
    23
    Thanked 0 Times in 0 Posts

    Question 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 )

  • #2
    New Coder
    Join Date
    Nov 2012
    Posts
    33
    Thanks
    23
    Thanked 0 Times in 0 Posts

    Question

    http://jsfiddle.net/dontspeak/2zfdq/4/
    U can view the output of above my code...
    Last edited by ebookz; 12-02-2012 at 12:55 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •