Since I have php working on this current website I have been playing around with a few forms. The motivation for this is that although I don't have a current need for any forms on this website I may want to offer a solution to Parish Councils that do.
I have developed a few Form concepts that would need to be completed if there is a requirement for such a form. I have seen what other website have offered in this regard and I think that I can do better. From what I have seen there is too much reliance on the offerings of others and not much thought on how the forms will be used. Validation of input and the response that the visitor is presented after a form has been submitted are points in question.
My principle of design is that my sites can be used on Smartphones as well as computers and tablets.
Responsive php pages
The example I have on my Form Handler page echos the Form entries to a responsive page. There seems no reason at the present time that all php forms cannot be made this way. This is a little more code overhead but it gives the option to direct the user to other things that they need to do, like making a payment if that was appropriate. Payment details could even be repeated here and even the option to print the page (Although I will need to do a lot more work on that). If I got really abitious I could even offer an option to export the (booking) date and details to a calendar.
Validation of input and Required Fields
The example that I have was taken from the W3C schools site and validates names for bad characters and an email in the correct format. The gender radio buttons has logic to both display an error if one is not checked and to show it selected if it is.
This is a very simple way of providing a means to send an email with a pre-configured subject and message content. However, yhis technique is often frowned upon because a mailto: link is often seen as a "spam magnet". This is mainly due to the "to:" address beig "farmed". If a "Throw-away" email is used this is not an issue.
- php Mail - sends an email using a php script
- Form Handler - echos Form input back to a responsive page.
- email setup - "throw-away" and Council Member addresses
- Validatation - needs to be run from server
- Form Elements - shows how (some of) these are displayed
- mailto: example - booking workaround
- Using a MySQL Database - Using a MySQL Database
- Programming - Why I got involved
- DIY - Websites made Easy
- VH Forms