Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9005223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:05:14+00:00 2026-06-16T01:05:14+00:00

Below I have a form which contains four text inputs: <form id=’updateForm’> <p><strong>Current Assessment’s

  • 0

Below I have a form which contains four text inputs:

<form id='updateForm'>

        <p><strong>Current Assessment's Date/Start Time:</strong></p>
        <table>
         <tr>
        <th>&nbsp;</th>
        <td><input type='text' id='currentId' name='Idcurrent' readonly='readonly' value='' /> </td>
        </tr>
        <tr>
        <th>Assessment:</th>
        <td><input type='text' id='currentAssessment' name='Assessmentcurrent' readonly='readonly' value='' /> </td>
        </tr>
        <tr>
        <th>Date:</th>
        <td><input type='text' id='currentDate' name='Datecurrent' readonly='readonly' value='' /> </td>
        </tr>
        <tr>
        <th>Start Time:</th>
        <td><input type='text' id='currentTime' name='Timecurrent' readonly='readonly' value=''/> </td>
        </tr>
        </table>    
    </form>

Now below I have a drop down option which goes at:

$sessionHTML .= sprintf("<option value='%s' style='color: %s'>%s - %s - %s</option>", $dbSessionId, $class, $dbSessionName, date("d-m-Y",strtotime($dbSessionDate)), date("H:i",strtotime($dbSessionTime))) . PHP_EOL;  

Now what I am doing is that the values displayed in the drop down menu is displayed in their relevant text inputs using this code below:

$('#sessionsDrop').change( function(){
        if( $(this).val() !== '' ){
            var text = $(this).find('option:selected').text();
            var split = text.split(' - ');
            $('#currentAssessment').val( split[0] );     
            $('#currentDate').val( split[1] );     
            $('#currentTime').val( split[2] );     
        }
    });

But the only problem I am having is how do I display the value of the option which is <option value='%s' ... $dbSessionId ... to be displayed in the text input #currentId?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T01:05:17+00:00Added an answer on June 16, 2026 at 1:05 am
    $('#currentId').val($(this).find('option:selected').val());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a code below where it contains a form which contains text inputs
I have a form with 2 text inputs and 2 radio buttons, as below:
I have this form tag below where the form submits to itself which I
I have a page in JQuery mobile, which contains a form. The form has
Hi I have a user input form which takes date in 2011-05-12 format. I
I have a form element that contains about 5 fields which final query is
I have a form which contains a whole bunch of checkboxes and some other
I have a form which is loaded from ajax response that contains some textarea
I am new in phonegap .I have two text field which contains mobile n.
I have a form which contains list of data, I added a checkbox in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.