Saturday November 14, 2009
Form field names are used to pass the information to the server
The names that you give to the fields in your form in order for the server side processing to work may not be appropriate to use to references them from JavaScript. Fortunately JavaScript has an alternate way of being able to reference form fields.
Referencing Form Fields
Friday November 13, 2009
JavaScript can add complex HTML to a web page
A new addition to my library of scripts that you can use on your own site is my new Form object script which provides you with an object that has simple to use methods to create a form with all the form field types you are most likely to want to use (it doesn't handle file inputs or optgroups but most of the time you will not need those). The object uses standard DOM calls to add the form into your web page as well as providing plenty of ways to reference the fields from your stylesheet in order to format it the way you want.
Dynamic Forms
Thursday November 12, 2009
Web pages are open source and there is nothing you can do to protect the content
Every so often I receive emails about my
Image Protection JavaScript that places the image in the background of a table with a transparent image in front of it. All of these emails have pointed out that there are other ways to obtain the image and that it is not really protected. In fact there is
no way to stop people obtaining the content of your web page since they have it already on their computer when they view your page. The same is true even if you use JavaScript to
encrypt your page source since your visitors all have something that can decrypt it for them (called a web browser). In fact applying something as simple as a
no right click script (which is the least effective way to try to protect anything) will just drive visitors away from your site. Any of these techniques may stop newbie web users from taking your code and images (and will do so at least as effectively as much longer codes and more expensive solutions found elsewhere on the web) but nothing will prevent someone who knows how the web works from obtaining whatever they want from your site.
Wednesday November 11, 2009
How far apart are specific characters? Find out with JavaScript
Continuing with our look at validating text input fields using JavaScript, the tenth tutorial in the form validation series looks at how we can test to make sure that selected characters in the input are a certain distance apart.
Minimum and Maximum Distance