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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:52:21+00:00 2026-06-11T16:52:21+00:00

I am trying to call a javascript function from the onchange attribute of the

  • 0

I am trying to call a javascript function from the onchange attribute of the select tag ! My issue is that I am passing the name attribute of the select to the function which always go null.

<body>


<form action="" method="post">
<select name="slct" id="name" onchange="rohan('measurement_conversion', '<?php echo isset($_POST["slct"])?$_POST["slct"]:"null" ?>')">
<option value="yes" selected="selected"> yes </option>
<option value="nopes"> nopes </option>
<option value="may be"> May be </option>
<option value="dont know"> dont know </option>
</select>
</form>

<div id="abc">
</div>


</body>

And here my javascript function

<script>

function rohan(var1, var2)
{

    document.getElementById("abc").innerHTML=var1 + "            " + var2;
}

</script>   

It always prints null..
Any help will be 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-11T16:52:22+00:00Added an answer on June 11, 2026 at 4:52 pm

    HTML:

    <body>
        <form action="" method="post">
            <select name="slct" id="name" onchange="rohan(this.value)">
                <option>Select</option>
                <option value="yes" selected="selected"> yes </option>
                <option value="nopes"> nopes </option>
                <option value="may be"> May be </option>
                <option value="dont know"> dont know </option>
            </select>
        </form>
    </body>
    

    JS:

    <script>
        function rohan(value)
        {
            //you can get the value from arguments itself
            alert(value);
        }
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to call a Flash function from javascript passing complex data types as
I'm trying to call a Javascript function from inside a Java Signed Applet that
I'm trying to call a controller method from a javascript function, I read that
I am trying to call a JavaScript function from icefaces check box component like
I am trying to call c# function from javascript the code i have tried
I am trying to call my function named isUrgencyTypeValid from my javascript code but
In my javascript function I am trying to call my global variable that is
I am trying to call a JavaScript function from an onclick trigger. HTML section:
I'm having problems trying to call a Javascript function from an enqueued javascript file
I am trying to call a javascript function from asp.net codebehind using onclientclick for

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.