script for form and also a 'clear the form' button

Posted on 2005-05-16
Last Modified: 2008-01-09

Can someone help me place a 'clear the form' button to the following form?:

Also, I need to write a php script to use the following form:

<form class="style79" action="form.php" method="post">
        <pre class="style19"><span class="style15">

Name:   </span><input size="25" name="first_name">
<span class="style15">
Email:   </span><input size="25" name="last_name">
<span class="style17">
Phone: </span><input size="25" name="state">
<span class="style17">
Shipping Address:

</span><textarea name="city" cols="40" rows="7"></textarea><span class="style17">
 <br>Select Style:
</span><select name="select" size="1"><option>Mens</option><option>Ladies</option></select>
        <div align="center">
<span class="style32">Click </span><a href="javascript: popup_show('MetalsPopUp');" class="style41">here</a>
<span class="style32"> if you would like more <bf><br>
information about our metals<br>

                <div id="MetalsPopUp" class="PopUp">
                    <a href="javascript: popup_hide('MetalsPopUp');">Click Here to Close </a><br>

                    <span class="style40">
Celestrium:  </span><span class="style39">This is a beautiful silver tone metal.  It is the most durable metal available in the recognition industry.  It will not tarnish or fade.</span>
                    <p class="style39"><strong>Gold-Tone Celestrium:</strong> This is a beautiful gold tone metal. The gold tone is achieved by embedding titanium into the molecules of the Celestrium. It is NOT plated so the gold color will not scratch, peel, or wear off. Additionally, it will not tarnish or fade.</p>
                    <p class="style39"><strong>Premium Silver:</strong> This is blend of sterling silver and platinum. It is a brilliant metal that has the look and feel of sterling silver with the strength of platinum.</p>
                    <p class="style39"><strong>10 Karat Gold:</strong> Available in yellow or white gold.</p>
                    <p class="style39"><strong>14 Karat Gold:</strong> Available in yellow or white gold.</p>
                    <p class="style39"><strong>18 Karat Gold:</strong> Available only in yellow gold.</p>
                  <span class="style38">                  </span></div>
                    <div id="SizerPopUp" class="PopUp">
                    <a href="javascript: popup_hide('SizerPopUp');">Click Here to Close </a><br>

                       <br><strong> Sizing Your Finger</strong><br><br>

<strong>Option 1:</strong>
We strongly recommend that you visit a local jewelry store or jewelry department in order to have your finger sized accurately by a jewelry professional.  In cases where this is not possible, you may use the option below.  Rings should slide over the knuckle and you should be able to turn the ring on your finger once it is on your finger.  Your finger will tend to swell in warm weather and shrink in cold weather, so please keep this in mind when determining your finger size.  In the event you need your ring re-sized, we reserve the right to charge a $30 re-sizing fee.

<br><br><strong>Option 2:</strong>
1. Print this page and cut out the ring sizer below.
2. Wrap the ring sizer around your finger with numbers facing out and then use transparent tape to fix it in place.
3. Test the ring size by putting the paper ring sizer over the knuckle.
4. When you are satisfied with your  fit, note the ring size number that appears at point of the arrow.
5.  When in doubt between two sizes, go with the larger size to ensure your ring fits.
(When printed this sizer should measure 73 mm wide.  If it does not, DO NOT use it.)

          <div align="left">
            <pre class="style19"><span class="style2"><strong>Metal Choice:<br></strong></span><select name="select" size="1"><option>Celestrium (Silver Tone):  $189</option><option>Gold Tone Celestrium (Gold Tone) $199</option><option>premium Silver (Silver and Platinum Blend):  $269</option><option>10 Karat White Gold:  $359</option><option>10 Karat Yellow Gold:  $359</option><option>14 Karat White Gold:  $499</option><option>14 Karat Yellow Gold:  $499</option><option>18K Yellow Gold:  $699</option></select>
            <p align="center" class="style25">Click <a href="javascript: popup_show('SizerPopUp');" class="style59">here</a>  to see how to size your finger.<br>
              <span class="style60"><span class="style61"><span class="style58">Click</span> <a href="popup/done1.pdf" onClick="newWindow('done1.pdf',300,300);return false;">here </a><span class="style58">to go to the ring sizer </span></span></span></p>

            <p class="style21"><span class="style19"><span class="style24">Ring size 300-1200<br>
                </span></span><span class="style19"><span class="style24">dropdown box<br>
                <span class="style2"><strong> </strong></span> </span></span><span class="style19">
                <select name="menu1"><option>300</option><option>350</option><option>400</option><option>450</option><option>500</option><option>550</option><option>600</option><option>650</option><option>700</option><option>750</option><option>800</option><option>850</option><option>900</option><option>950</option><option>1000</option><option>1050</option><option>1100</option><option>1150</option><option>1200</option></select>
          <div align="left">
            <pre class="style19"><strong>Above side one<strong> engraving:</strong>  
(max 11 characters) (fill in blank)</strong>
<input name="textfield" size="11" maxlength="11" type="text">
        <p class="style21"><span class="style19"><strong>Inside Engraving (max 15 characters)<br>
            </strong></span><span class="style19"><strong><span class="style23">(fill in the blank) &nbsp;<br>
            </span></strong></span><span class="style19"><strong>
            <input name="textfield" size="15" maxlength="15" type="text">
        <p class="style21"><span class="style19"><strong>Comments:</strong></span></p>
        <p class="style21"><span class="style19"><strong>
          <textarea name="textarea" cols="40" rows="7"></textarea>
          <input value="Submit" name="Submit" type="submit">

Question by:weikelbob
    LVL 16

    Accepted Solution


    To clear a form you can simply add the following

    <input type="reset" name="Reset" value="Reset">

    You can place it, say just after your submit button

    For PHP to access the form, it is as easy as a pie.

    Say in your form you have an input box called "username"
    And you send the form using POST method.

    Then inside PHP, you can simply say

    $_POST ['username']

    then you can get the values~~~ so easy

    LVL 7

    Author Comment

    Thanks Vicker, I like the way you showed me how to simply write my own php for forms.


    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    This is a general how to create your own custom plugin system for your PHP application that you designed (or wish to extend a third party program to have plugin functionality that doesn't have it yet).  This is not how to make plugins for existing s…
    Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now