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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:44:47+00:00 2026-06-12T04:44:47+00:00

I have this form: <form onsubmit=serverconnect(‘Div1’, ‘query.php’); return false; Minimum Discount: <br /> <input

  • 0

I have this form:

<form onsubmit="serverconnect('Div1', 'query.php'); return   
false;" 
Minimum Discount: <br />
<input type="radio" value="20%" name="discount" /> 20% <br />
<input type="radio" value="15%" name="discount" /> 15% <br />
<input type="radio" value="10%" name="discount" /> 10% <br />
<input type="radio" value="5%" name="discount" /> 5% <br />
<input type="submit" value="Refine Search" />
</form>

On submit, the form calls the following ajax script

<script language="javascript" type="text/javascript">


var xmlhttp = false;


if (window.XMLHttpRequest)
{
    xmlhttp = new XMLHttpRequest(); 
}
else if (window.ActiveXObject)
{
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}


function serverconnect(divID, datalocation)
{
var1=$clickvalue;
if(xmlhttp)
{
    var obj = document.getElementById(divID);
    xmlhttp.open("GET", datalocation);

    xmlhttp.onreadystatechange = function()
    {
        if (xmlhttp.readyState == 4 &&
        xmlhttp.status == 200)
        {
        obj.innerHTML = xmlhttp.responseText;
        }
    }
    xmlhttp.send(null); 
}

}
</script>

I need to get the form data through to my query.php page (which is what the ajax is outputtng) to modify its output, without using the jquery library.

So is there a way to pass the form data through the ajax function to the page that the function calls?

  • 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-12T04:44:48+00:00Added an answer on June 12, 2026 at 4:44 am

    Yes you can pass form data using ajax. As you are using GET method only you have to embed your data with the page like this

    <input type="radio" value="20%" name="discount" id="discount" /> 20% <br />
    
    
    var obj = document.getElementById(divID);
    var disc = document.getElementById("discount");
    xmlhttp.open("GET", datalocation + "?disc="+disc);
    

    and in query.php use $_GET['disc'] for getting get data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this form, with 2 submit buttons: <form method=post onsubmit=send_mail(this);return false> <select name=liste>
i have a form which onsubmit i return false to cancel the submit action
I have this form: <tbody> <tr> <th>ID</th> <th>Name</th> <th>Birthdate</th> <th><input type=text autofocus=autofocus name=textinput1/></th> <th><input
I have this form with a date input. echo $this->Form->create('Nodata'); echo $this->Form->input('date1', array('type' =>
I have this form: <form> <div class=box> <h1>Contact form :</h1> <label> <span>Typ: </span> <input
I have this form submit code: Event.observe(window, 'load', init, false); function init() { Event.observe('addressForm',
I have a form that onsubmit calls an ajaxFunction()... The ajaxfunction calls a php
I have the form: <form name=form1 method=post action=test.php?date=javascript:this.form.date2.value> I am using a DatetimePicker for
I've attached onsubmit handler in a form tag like this: <form action=file.php method=post onsubmit=
I have this form, in which i need to populate a combo box with

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.