[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2005-05-16
2
Medium Priority
?
344 Views
Last Modified: 2008-01-09
Hello,

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>
      </pre>
        <div align="center">
         
                      
             
              <div>
<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>
</bf></span></div>

                <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.
<br>
(When printed this sizer should measure 73 mm wide.  If it does not, DO NOT use it.)
             
                       
            </div>
   



          <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>
          </pre>
            <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>
                </span></p>
          </div>
          <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">
      </pre>
          </div>
       
        <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">
</strong></span></p>
        <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>
        </strong></span></p>
        <p>
          <input value="Submit" name="Submit" type="submit">
        </p>
      </form>



Bob
0
Comment
Question by:weikelbob
2 Comments
 
LVL 16

Accepted Solution

by:
vickerleung earned 1600 total points
ID: 14015521
Bob,

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

Cheers
Vicker
0
 
LVL 7

Author Comment

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

Bob
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
The title says it all. Writing any type of PHP Application or API code that provides high throughput, while under a heavy load, seems to be an arcane art form (Black Magic). This article aims to provide some general guidelines for producing this typ…
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses
Course of the Month19 days, 8 hours left to enroll

873 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