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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:33:27+00:00 2026-05-28T06:33:27+00:00

Alright here is what I am attempting to do. I have a form written

  • 0

Alright here is what I am attempting to do. I have a form written in HTML. It has a few HTML5 elements to it though. What I would like to happen, is when the user fills out all the required fields (validated with PHP and some HTML5) and submits the form, it will export to an existing XML file. The form also uses AJAX to validate as the user fills out the fields, and to validate the form as a whole (once submitted) without reloading my page.

The XML file is just a framework of empty tags set up to receive the information from form submissions, built upon a schema (I made) to restrict it to certain values and what not. I would also need to be able to have a script to validate the new XML values against the schema to make sure all values are valid, and if not return an error message.

The XML Schema validation is as close as possible to the PHP validation with a few character amount limits added in here and there.

If you need me to post the schema for the XML file in order to give a more specific answer then I will upon request.

XML Framework:

    <form>
**<!-- First Name -->**
    <fname></fname>

<!-- Last Name -->
    <lname></lname>

<!-- Phone Number -->
    <phone></phone>

<!-- Email -->
    <email></email>

<!-- Website -->
    <website></website>

<!-- Subject -->
    <subject></subject>

<!-- Message -->
    <message></message>

</form>

HTML Form:

<form method="post" action="php/validator.php" name="contactform" id="contactform" autocomplete="on"> 

    <fieldset> 

        <legend>Contact Details</legend> 

        <div> 
            <label for="fname" accesskey="F">Your First Name*</label>
            <input name="fname" type="text" id="name" placeholder="Enter your first name" tabindex="1" required /> 
        </div>

        <div> 
            <label for="lname" accesskey="L">Your Last Name*</label>
            <input name="lname" type="text" id="name" placeholder="Enter your last name" tabindex="2" required /> 
        </div> 

        <div> 
            <label for="email" accesskey="E">Email*</label> 
            <input name="email" type="email" id="email" placeholder="myEmail@example.com" pattern="^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$" tabindex="3" required /> 
        </div> 

        <div> 
            <label for="phone" accesskey="P">Phone <small>(optional)</small></label> 
            <input name="phone" type="tel" id="phone" size="12" placeholder="555-555-5555" tabindex="4" /> 
        </div> 

        <div> 
            <label for="website" accesskey="W">Website <small>(optional)</small></label> 
            <input name="website" type="url" id="website" placeholder="www.yourWebDomain.com" tabindex="5" /> 
        </div> 

    </fieldset> 

    <fieldset> 

        <legend>Your Comments</legend> 

        <div> 
            <label for="subject" accesskey="S">Subject*</label> 
            <select name="subject" id="subject" tabindex="6" required="required"> 
                <option value=""></option> 
                <option value="Support">Support</option> 
                <option value="Sale">Sales</option> 
                <option value="Bug">Report a bug</option>
                <option value="Other">Other</option>
            </select>
        </div>
        <div> 
            <label for="comments" accesskey="C">Comments*</label>
            <textarea name="comments" cols="40" rows="3" id="comments" class="comments" placeholder="Enter your comments" spellcheck="true" required tabindex="7"></textarea> 
        </div> 

    </fieldset> 
    <input type="submit" class="submit" id="submit" value="Submit" tabindex="9" />
</form>
  • 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-28T06:33:28+00:00Added an answer on May 28, 2026 at 6:33 am

    After validation use PHP to capture the form fields, wrap them in XML elements, then save it.

    e.g.

    <form>
        <fname><?php=$_REQUEST['fname']?></fname>
        <lname><?php=$_REQUEST['lname']?></lname>
        ...
        ..
    </form>
    

    No sense in double validation either, with one slightly different than the other. It would be annoying for the user to submit their data successfully but somehow get rejected in the backend without warning. DOMDocument is a little overkill as well.

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

Sidebar

Related Questions

Alright here's the situation, I have an application written in the Zend_Framework, that is
Alright so here is the question. I have a user class which contains a
Alright, here's what I'm trying to do. I'm attempting to write a quick build
Alright, here is my problem i'm trying to solve. I have an index page
Alright, here's a quick explanation of what I am doing: I have a website
Alright, Here's the gist of what I'm planning to do. I'm going to have
Alright, here's an odd one from an MS Access database I'm running. I have
Alright, here we go. I have a cocos2d app, and there are targets that
Alright, so what I'm attempting to do here, is select from a datatable all
Alright so a quick SQL question here(using sql-server-2008). I have a mapping table names

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.