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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:19:33+00:00 2026-06-06T16:19:33+00:00

Well, I’ve run into a a problem. I’m in the middle of modifying an

  • 0

Well, I’ve run into a a problem. I’m in the middle of modifying an ATS system and need to add some functionality yet I’ve run into a strange thing in JavaScript. Basically I need to change a set of form values based on a selection from a drop down menu and the code works… when there is only one thing to change. The moment I add other sections that need to change it stops working. I’ve ran all over the internet and many Stack questions but nothing seems to help. The code that works is:

<form id="test" name="test">
        <select id="statusID" name="statusID" onchange="javascript: return updateForm();">
                <option value="" selected></option>
                <option value="test1">One</option>
                <option value="2">Two</option>
        </select>
        <br />
        <input type="hidden" value="Test" id="RS" name="RS" />
    </form>

<script type='text/javascript'>
function updateForm()
{   
    if (document.getElementById('statusID').selectedIndex  == "2") 
                document.getElementById('RS').value = '200' 

                else if(document.getElementById('statusID').selectedIndex == "1")
                document.getElementById('RS').value = 'RSP'
}
</script>

This works when I test it on the server yet when I add the other fields that need to be populated it stops working altogether. The JavaScript I’m using is below. I’ve tried a few variations based on code I’ve seen but to no avail.

<script type='text/javascript'>
function updateForm()
{

    if (document.getElementById('statusID').selectedIndex  == "2") 
                document.getElementById('RS').value = '200'
                document.getElementById('RSDATE').value = '200'
                document.getElementById('RSP').value = '200'

                else if(document.getElementById('statusID').selectedIndex == "1")
                document.getElementById('RS').value = 'RSP'
                document.getElementById('RSDATE').value = 'RSP'
                document.getElementById('RSP').value = 'RSP'          
            }

</script>

I should note that I am in no way proficient with JavaScript at all. Nor am I proficient in PHP… yet I’m modifying a PHP based ATS system. This code is the second to last block between me and the goal (finishing the ATS system) so help would be greatly appreciated.

  • 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-06T16:19:35+00:00Added an answer on June 6, 2026 at 4:19 pm

    From the question’s context, you should add braces following if and else if: (also noted by Combat, semicolons should be added)

            if (document.getElementById('statusID').selectedIndex  == "2")  {
                document.getElementById('RS').value = '200';
                document.getElementById('RSDATE').value = '200';
                document.getElementById('RSP').value = '200';
            }
            else if(document.getElementById('statusID').selectedIndex == "1") {
                document.getElementById('RS').value = 'RSP';
                document.getElementById('RSDATE').value = 'RSP';
                document.getElementById('RSP').value = 'RSP';      
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Well, I have a application which somehow requires some system resources, but how do
Well, i need to check if some fields are empty when submiting get an
Well, i have the following need: create 3 dropdownlist with dependencies. My table in
Well im here because i have a problem. i have code that was created
Well, this is an interesting problem. I have an ASP.NET MVC3 Intranet application running
Well, I got problem here with opengl ES stuff (just started to learn about
Well, that might be a strange question, and maybe just because I'm not familiar
Well, having decided to get to know some of the basic functions in R
Well, here's what I have to do. I need to trim the whitespaces in
Well basically, I'm having a problem, how to make a function in haskell to

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.