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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:11:22+00:00 2026-05-30T19:11:22+00:00

I have a very simple form.I want to insert the form data in mysql

  • 0

I have a very simple form.I want to insert the form data in mysql database.using ajax.

I need to pick data from form and send them as xml to the server.

the form is as :

              <form>
                     Name:<input type="text" id=name/>
                     Contact<input type="text" id=contact/>
              </form>

And i am picking the data from my form using js as :

              function GetData(form)
                     {
                             var name=document.getelementbyid('name');
                             vat contact=document.getelementbyid('contact');
                     }

               function Ajax
                        {
                            " Here i want to send the form datas as an xml to the server"
                        }

Can any one help me how to do this .And also how to receive the the request from server as xml and insert to database.

Just give me the proper way.Not Query string or json or jquery.I want to use xml using ajax

Thanks,

  • 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-05-30T19:11:24+00:00Added an answer on May 30, 2026 at 7:11 pm
     function GetData(form)
    {
    var name=document.getelementbyid('name');
    var contact=document.getelementbyid('contact');
    Ajax(name,contact);
                         }
    
    
    function Ajax(name,contact)
    {
    if (window.XMLHttpRequest)
      {
      xmlhttp=new XMLHttpRequest();
      }
    else
      {
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    xmlhttp.onreadystatechange=function()
      {
      if (xmlhttp.readyState==4 && xmlhttp.status==200)
        {
        var response=xmlhttp.responseText;
        }
      }
    //var datas='?name='+name+'&contact='+contact;
    var xmlval='<name>'+name+'</name><contact>'+contact+'</contact>';
     var datas='?xmlvalue='+xmlval;
    xmlhttp.open("GET",'phpfile.php'+datas,true);
    xmlhttp.send();
    }
    

    Important question: Why do you need XML to submit?

    Also, to use XML, look up SimpleXML, and to save to database, there are a lot tutorials.

    Update: if you meant the response as XML? That’s just like the same as in JS. And to use it in JS, look at this. However, in that case, uncomment the commented line and comment the next 2.

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

Sidebar

Related Questions

I have a very simple scenario where I want to POST the form using
I have a very simple entry form. After a button is pressed, I need
I am posting a very simple form using a method I have used frequently
I have a very simple WPF application in which I am using data binding
I have a very simple form for data input. Just labels with inputs. But
I want to create a very simple javascript form validation. I have two input
i have very simple basic form in HTML and i want to validate the
Ok, so I have a very simple form with next to no logic in
I have a very simple XAML form, that has one namespace definition. For some
i have very simple problem. I need to create model, that represent element of

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.