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

  • SEARCH
  • Home
  • 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 841369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:47:01+00:00 2026-05-15T05:47:01+00:00

How can I change a form’s input value with javascript depending on witch combobox

  • 0

How can I change a form’s input value with javascript depending on witch combobox item is selected. I have a form with some imported values, and there is a field of witch imported value can be changed via a combobox. In my case:

print("<input type='hidden' name='issue_array[{$issue["nr"]}][\"supplier\"]' value='{$issue["supplier"]}' />");

I have a combobox, that if I change it’s value, should change the value of the input above.

This is what I tried:

print("<select name='supplier_combo' onchange='setSupplierInputValue(this.value, ${issue['nr']})'>");

and the script:

  echo "\r\n" . '<SCRIPT TYPE="text/javascript">' . "\r\n";
  echo 'function setSupplierInputValue(value, issue_nr)' . "\r\n";
  echo '{' . "\r\n";     
  echo '      issue_array[issue_nr]["supplier"] = value;';         
  echo '}' . "\r\n";     
  echo '</SCRIPT>'. "\r\n"; 

But it doesn’t work, please help.

  • 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-05-15T05:47:02+00:00Added an answer on May 15, 2026 at 5:47 am

    change your line

    issue_array[issue_nr]["supplier"] = value;
    

    to look like this (you have to select the hidden field by using getElementsByName – or set an id for the hidden field and use getElementById):

    document.getElementsByName('issue_array['+issue_nr+']["supplier"]')[0].value = value;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 533k
  • Answers 533k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can do it inside an add-on, prior to Firefox… May 17, 2026 at 12:33 am
  • Editorial Team
    Editorial Team added an answer I want this to happen behind the scenes and I… May 17, 2026 at 12:33 am
  • Editorial Team
    Editorial Team added an answer If it's going to be a notification for all sorts… May 17, 2026 at 12:33 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

how can I change a form's action with prototype ? I've seen plenty of
I have an html form that has the following structure: <input type=text name=title />
I want a form where user can change password. I am able to encrypt
I have a search form with default values. As the user loades the page,
I have a webpage with a form element and a popup window (opened by
In Delphi 2006, I am showing a modal form. User input in that form
I succeed in creating a sortable portlet system for a existing CMS. I also
In my application an User has many Projects . I want to create a
Say you're writing a web page for fruit vendors using Spring MVC's SimpleFormController ,

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.