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 8999581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:11:57+00:00 2026-06-16T00:11:57+00:00

I will pass value for multiple fields to a text field. There is a

  • 0

I will pass value for multiple fields to a text field. There is a problem, select options, its value are 0 and 1, my question is how to make sure that it pass option text instead of 0 and 1? That mean pass MYR instead of 0 and SGD instead of 1?

http://jsfiddle.net/e2ScF/64/

HTML:

<select id="Salary_para1">
  <option value="">Choose...</option>
  <option value="0" selected>MYR</option>
  <option value="1" >SGD</option>
</select>
<input id="Salary_value" type="text"/>
+ <input type="checkbox" id="Salary_para2" name="Salary_para2" value=" + Allowance"  />Allowance<br/>
<input type="text" id="targetTextField" name="targetTextField" size="31" tabindex="0" maxlength="99" value="">

CODE:

$(function() {
  setTarget();
  $("#Salary_para1,#Salary_para2").change(setTarget);
  $("#Salary_value").keyup(setTarget);

  function setTarget() {
    var tmp = $("#Salary_para1").val();
    tmp += $("#Salary_value").val();
    tmp += $("#Salary_para2:checked").val() || '';
    $('#targetTextField').val(tmp);
  }
});
  • 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-16T00:11:58+00:00Added an answer on June 16, 2026 at 12:11 am

    To get the text and not the value of whatever is selected in the dropdown, you’d have to target the selected option and get the text from that element :

    var tmp = $("option:selected", "#Salary_para1").text();
    

    FIDDLE

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I will pass value for multiple fields to a text field. There is a
I am working on quiz application . For each question there are multiple options
i will like to pass other than title and snippet value to the OverlayItem,
What will the return value for performSelector: if I pass a selector that returns
I am trying to make an app that will pass data between two servers
I have an application that will be spawning multiple threads. However, I feel there
I am going to develop a search page where I will have multiple fields
I don't know if this question will make sense to begin with... Example Given:
I want to pass the value of 'undefined' on a multiple parameter function but
I want to pass around some values in an array that will always be

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.