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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:49:13+00:00 2026-06-04T20:49:13+00:00

Okay, I’ve been struggling with this for a few hours now. I’m using ajax

  • 0

Okay, I’ve been struggling with this for a few hours now. I’m using ajax to update a div in my site with a php code however, i’m trying to send parameters in the function from the external javascript file to update the correct link(there are multiple drop down boxes)

for example: this is my select box

<script type='text/javascript' src='ajax.js'></script>//include ajax file
<select onchange='MakeRequest(raceupdate);
        this.options[this.selectedIndex].value;'> //so no use of a button is needed to auto link to anchor tag
        <option>Deathmateched</option>
    <?php
        dmList()
        ?>

 </select>

Then next my external ajax function MakeRequest().

function MakeRequest(value)
{
    var linkInfo = "teleport.php?call=" + value;//create appropriate link depending on function parameters  
    var xmlHttp = getXMLHttp();

    xmlHttp.onreadystatechange = function()
    {
        if(xmlHttp.readyState == 4)
        {
            HandleResponse(xmlHttp.responseText);
        }
    }     

    xmlHttp.open("GET", linkInfo, true); //update page using link info variable created above
    xmlHttp.send(null);

}

So as you can see I’m trying to pass a sting of text into this function, but I seem to be failing somewhere.

  • 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-04T20:49:14+00:00Added an answer on June 4, 2026 at 8:49 pm

    You probably want to setup your tag to pass “this”. I don’t see where your raceupdate variable is declared, unless it’s global… in which case you should show us what you’re doing with that variable.

    <select onchange='MakeRequest(this);'> 
        <option>Deathmateched</option>
        <?php
            dmList();
        ?>
    

    If you did it that way, you’d have to change this function as such:

        function MakeRequest(element)
        {
        var linkInfo = "teleport.php?call=" + element.value;//create appropriate link depending on function parameters  
        var xmlHttp = getXMLHttp();
    
        xmlHttp.onreadystatechange = function()
        {
            if(xmlHttp.readyState == 4)
            {
                HandleResponse(xmlHttp.responseText);
            }
        }     
    
        xmlHttp.open("GET", linkInfo, true); //update page using link info variable created above
        xmlHttp.send(null);
    
    }
    

    And what are you trying to do here?

    this.options[this.selectedIndex].value;
    

    In your comments, it looks like you’re saying you want to jump to an anchor tag? If so, then you would want to do something like

    var anchorTag = document.getElementID("YOUR_ANCHOR_TAG_ID");
    anchorTag.focus();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, before you guys go nuts -- this is just a small site, temporary
Okay so my question is this. Say I have a simple C++ code: #include
Okay, here's the rundown. I'm developing a video hosting site with PHP and jQuery
Okay,I've been following this tutorial http://coenraets.org/blog/android-samples/androidtutorial/ Basically it gives me exactly what i need
Okay the title cannot explain the situation correct enough. Now this is it, I
Okay, so I have the weirdest problem right now. My code is fine! It
Okay, so I've known about this for like 600 years now, but I've only
Okay, I'm reading about Linux kernel development and there are some code snippets using
Okay so im working on this php image upload system but for some reason
okay, here's what I've been scratching my head over for the last few days.

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.