![]() | |||||||
The Basics Of Web Forms.Whenever you want people to enter data and send it to you, you need a web form. Whether the data is as simple as a username and password or as complicated as a full address form, the basic principles remain the same. These properties aren't very well-named, but they basically tell the browser where and how you want things that are entered on the form to be sent. The file named in action should be a script that is prepared to do something with the data from your form, such as entering it into a database. It's worth knowing that you can make use odd things like "mailto:youremail@address.com" as the action (that one submits by email), although it's not recommended. Once you've got that, the next step is to put input tags between the form tags. There are lots of different kinds of input tags, and you say which kinds you want using the 'type' property. For example: one This is a checkbox (the boxes you can tick). The name property lets you give the checkbox a name so you can refer to it your scripts later on. The text between the tags ('one') is what appears next to the tick box. Other input types include: text - a text box. radio - a set of options where only one can be chosen. button - a clickable button. file - a box that allows someone to upload a file to your site. submit - a special kind of button that sends the result of the form to the server. reset - a button that clears everything a user has entered in the form, so they can start over. Web Forms and CSS. Those forms you just made, however, aren't going to be pretty: they'll be displayed in only the most basic style, one after the other and surrounded by ugly boxes. Luckily, it's simple to add some styling using CSS in exactly the same way as you would add it to normal text. You can change the boxes' background-color, font (font-family), remove the borders, and so on. You might also like to make use of the various CSS 'events', such as the hover event. Take a look at this example CSS: input:hover { background-color: yellow; } It makes the input box go yellow when the user hovers over it – combine that with a bit of Javascript that automatically moves the typing cursor into input boxes that the user hovers over, and you've got an easier to use form right away. Try as much as you can to make your input boxes look and behave like ones you like in software you find easy to use, and you won't go far wrong. Validating Input. Once the user has typed something in, you need to validate it – that is, check it makes sense. If they're supposed to be filling in an email address, there needs to be an @ in there somewhere. If they've chosen a username, you need to make sure it's not already been taken by someone else. That kind of thing. There are two ways of validating input: client-side and server-side. To put it simply, client-side validation is done by Javascript, and is purely there for the user's convenience, so they don't have to submit a form only to find out it was wrong. Server-side validation will be done with a language like PHP, and is the final check before the data gets written to a database – if it's wrong at that point, you have to throw the user an error page and ask them to re-enter the relevant piece of information. It's very important that you don't leave vital checking purely up to the Javascript, as some of your visitors may have Javascript turned off, or may even turn it off deliberately to get around your checks. The last thing you want is people being able to fill your database with bad information.
|
Web DesignWhat You See Isn't Always What You Get. Setting Up A Test Server On Your Own Computer. Pros And Cons Of Flash-based Sites Registering Your Users By Stealth. Uploading Your Website With FTP. Putting Multimedia To Good Use. Focus On The User: Task-Oriented Websites.
| ||||||
Web DesignHiring Professionals: 5 Things To Look For. ... include: Which browsers are you going to test with? (They should reply with 'as many as possible'). What is the purpose of my website? (They should be able to explain the point of the site simply). Setting a Price. Many web designers simply have no idea what kind of price to charge for their services. ... Web Design Elements You Should Avoid Having On Your Site ... design than purely graphics -- user accessibility is one big part of it too! You should design the text on your site to be legible and reasonably sized to enable your visitors to read it without straining their eyes. No matter how good the content of your website or your sales copy is, if it's illegible ... ... format for these pages (HTML), and wrote the first web browser to view them with, as well as the first web server for sending them to other people's web browsers. Links might not seem like much now, but at the time they were revolutionary. Imagine what the web would be like if you had to keep typing long ... Some Places To Go For More Information. ... pretty comprehensive set of forums about web design, and a very good place to go if you're having a problem that you haven't been able to solve for yourself. As long as you take the time to find the right forum to post your question in, you should find the people there helpful and knowledgeable. The Site ... Titles And Headlines: It's Not A Newspaper. ... Titles are some of the most vital parts of your site, especially if it consists of a series of articles. Yet they're also some of the most ignored elements of all web pages, and more difficult than you'd think to do correctly. You have to realise that you're not writing headlines it's more interactive ...
| |||||||
| © 2000 Find Any Info Sitemap Privacy Statement Contact Us | |||||||