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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:29:26+00:00 2026-06-04T10:29:26+00:00

my select option in HTML is, <select name=id id=id style=width:400px; onChange=loadAjax(this.value);> <select name=name id=name

  • 0

my select option in HTML is,

<select name="id" id="id" style="width:400px;" onChange="loadAjax(this.value);">
<select name="name" id="name" style="width:400px;">

Which loads the ajax function (using javascript) when the value is change in SELECT (html).
But I am in different requirement, that when this select input loads, it should call the loadAjax function directly, and on change as well.

How it could be possible?
I tried some things like window.onload, onload, but nothing worked.

  • 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-04T10:29:27+00:00Added an answer on June 4, 2026 at 10:29 am

    Given that you’ve tagged your question with “jquery”, I’d suggest a jQuery solution:

    $(document).ready(function() {
        $("#id").change(function() {
            loadAjax($(this).val());
        }).change();
    });
    

    This defines the change handler and then immediately triggers it. (You would remove the inline onclick from your html.)

    Or without jQuery perhaps something like this:

    window.onload = function() {
       loadAjax(document.getElementById("id").value);
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my html partial code <select name=number[] style=width: 350px; multiple=multiple size=2> <option value=one>one</option>
This is my HTML <select name=countries id=countries MULTIPLE size=8> <option value=UK>UK</option> <option value=US>US</option> <option
I have this html: <select name=garden multiple=multiple id=garden> <option value=1>Flowers</option> <option value=2>Shrubs</option> <option value=6>Trees</option>
DataPull.php: CASE CityList: echo <select style='width:132px;height:243px;' size='17' id='CityListA' name='CityListA' onChange='SubCityList(this.value);'>; $result = $db-> query(SELECT
This is where i put a popup box into echo <tr><td>.$set['Name'].</td><td>.$set['Position'].</td><td><select name='aaa'><option value='default'>Not Share</option><option
html += <table><tr><td> <label for='id_first_name' ><b>Timezone:</b></label> </td>; html += '<td><select id=timezone name=nodes style=width:300px;margin:5px;>'; {%
Is there a style for a select option's selected color? For example: <HTML> <BODY>
I have this HTML: <select multiple='multiple' size='3'> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> </select> Using
I have the following code in html: <select> <option text=item9 value=9></option> <option text=item10 value=10></option>
I have the following HTML markup:- <select name=List1 id=l1> <option>One</option> <option>Two</option> <option>Three</option> <option>Four</option> <option>Five</option>

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.