Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

120
Views
how to get html get id value in input

hello I'm new in html I'm trying to get id value in input field. now I'm abele to get id value in dropdown input , now I'm trying to get in normal input.

I need get ID value in this input

 <div class="col-md-3">
 <div class="form-group">
     <label  > PRICE:<span style="color:red;">*</span> </label>
     <input   class="form-control  " name="course_Price" id="course_Price" required> </div>
  </div>
  </div>

my script for get value in dropdown field

<script type="text/javascript">
    $(document).ready(function() {
        $('#student_courses').on('change', function() {
            var stateID = $(this).val();
            if(stateID) {
                $.ajax({
                    url: '/Student_Course_get_price/'+stateID,
                    type: "GET",
                    dataType: "json",
                    success:function(data) {                      
                        $('#course_Price').empty();
                        $.each(data, function(key, value) {
                        $('#course_Price').append('<option value="'+ value +'">''</option>');
                        });
                    } 
                });
            }else{
                $('#course_Price').empty();
            }
        });
    });
</script>

My dropdown input

  <div class="col-md-2">
     <div class="form-group">
         <label for="videoUrl1">Course Fees :<span style="color:red;">*</span></label>
          <select name="course_Price" id="course_Price" class="form-control dynamic" data-dependent="course_Price">
       <option value=""></option>
          </select>
      </div>
   </div>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

In the success function of your ajax call, use $('#course_Price').val(value);

$.each(data, function(key, value) {
  $('#course_Price').append('<option value="'+ value +'">''</option>');
  $(‘#course_Price’).val(value);
});
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!