Reply
Looking for some help with my form please
Old 11-07-2009, 02:49 AM Looking for some help with my form please
Average Talker

Posts: 29
Name: Jon
Trades: 0
I have a simple form that I found from a tutorial but am now lost. Unfortunately I haven't learned forms yet.

My questions are: (based from the code below)

1. What do I add to my code to make the submit button, submit the info.
2. What do I add to my code to make my required fields, actually required upon submission?


HTML
Code:
<div id="stylized" class="myform">
                <form id="form" name="form" method="post" action="index.html">
                    <label>Name&nbsp;*</label>
                        <input type="text" name="name" id="name" />

                    <label>Email&nbsp;*</label>
                        <input type="text" name="email" id="email" />

                    <label>Website (URL)&nbsp;*</label>
                        <input type="text" name="website" id="website" />

                    <label>Phone Number</label>
                        <input type="text" name="phone number" id="phone number" />

                    <button type="submit"><img src="images/submit.gif" /></button>

                </form>
            </div>
CSS
Code:
.myform{
width:245px;
height: 340px;
padding: 60px 12px 0px 12px;
font-size:13px;
color: #ffffff;
}
#stylized{
background: url(images/quote-request-2.gif) no-repeat;
}
#stylized label{
display:block;
font-weight:bold;
width:140px;
text-align: left;
margin-left: 10px;
}
#stylized input{
font-size:13px;
padding:4px 2px;
width:200px;
margin:2px 0 10px 10px;
}
#stylized button{
background: none;
border: none;
margin-left:111px;
width:109px;
height: 30px;
}
Foppa is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 11-07-2009, 05:38 AM Re: Looking for some help with my form please
Skilled Talker

Posts: 86
Name: Brent
Location: Online
Trades: 0
I don't think the validation is going to work in HTML. You're doing to need PHP or some JavaScript for that

Last edited by Custom Cars; 11-07-2009 at 05:43 AM..
Custom Cars is offline
Reply With Quote
View Public Profile Visit Custom Cars's homepage!
 
Old 11-07-2009, 05:40 AM Re: Looking for some help with my form please
chrishirst's Avatar
Super Moderator

Posts: 22,214
Location: Blackpool. UK
Trades: 0
Quote:
1. What do I add to my code to make the submit button, submit the info.
HTML Code:
<input type="submit" name="go" value="Send it!" />
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | People Counting System | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-07-2009, 05:42 AM Re: Looking for some help with my form please
chrishirst's Avatar
Super Moderator

Posts: 22,214
Location: Blackpool. UK
Trades: 0
Quote:
What do I add to my code to make my required fields, actually required upon submission?
With javascript or serverside code
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | People Counting System | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-07-2009, 05:46 AM Re: Looking for some help with my form please
Average Talker

Posts: 29
Name: Jon
Trades: 0
Quote:
Originally Posted by chrishirst View Post
HTML Code:
<input type="submit" name="go" value="Send it!" />
Thank you.

How do I tell it where to send the info? Is that where the javascript comes in?
Foppa is offline
Reply With Quote
View Public Profile
 
Old 11-07-2009, 05:47 AM Re: Looking for some help with my form please
chrishirst's Avatar
Super Moderator

Posts: 22,214
Location: Blackpool. UK
Trades: 0
Nope, that's what the action attribute value does.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | People Counting System | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-07-2009, 05:48 AM Re: Looking for some help with my form please
chrishirst's Avatar
Super Moderator

Posts: 22,214
Location: Blackpool. UK
Trades: 0
http://www.w3schools.com/html/html_forms.asp
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | People Counting System | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-07-2009, 06:02 AM Re: Looking for some help with my form please
Average Talker

Posts: 29
Name: Jon
Trades: 0
I see, thank you.

Quote:
Originally Posted by chrishirst View Post
HTML Code:
<input type="submit" name="go" value="Send it!" />

Where do I put that exactly, just as the last line of code?

Also, is this line correct that I have in my code? And/or do I need to combine it with the code you gave me since it's the submit image?

Code:
<button type="submit"><img src="images/submit.gif" /></button>
Foppa is offline
Reply With Quote
View Public Profile
 
Old 11-07-2009, 06:39 AM Re: Looking for some help with my form please
chrishirst's Avatar
Super Moderator

Posts: 22,214
Location: Blackpool. UK
Trades: 0
http://www.w3schools.com/tags/tag_button.asp
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Growing old is mandatory - Growing up is optional
Code Samples | People Counting System | Bits & Bobs
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-07-2009, 03:02 PM Re: Looking for some help with my form please
Banned

Posts: 3
Name: Carmen Shah
Trades: 0
Wow w3schools a great site thanks chrish
carmen007 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Looking for some help with my form please
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.13532 seconds with 13 queries