|
![]() Javascript (5)Simple E.Mail Form You can have an e.mail form on your website that does a lot of the 'filling in' for you! This way you can have a pre-determined 'subject' line if you want. You have the choice here of a text link or a button. It's up to you! You will have noticed that the Javascript prompts you for a couple of inputs. They are highlighted in blue which means you can click OK to carry on, or over-type the line with whatever you want. Once you have clicked OK after the last prompt your e.mail system is automatically started and the lines have been filled in for you. All you have to do then is type in the 'Body' part with what you want to say! The code for this is as follows: <script>
To use a text link, delete the green line. To use a button link, delete the pink line. Remember, the red words can be replaced with your own. There is one other way of putting in pre-determined lines in an e.mail which is not Javascript, but could be useful all the same. Let's say you want to have your visitor send you an e.mail just to say they have visited your website and they like what they saw. Okay, let's get them to send you a message saying just that! The secret is in the script - as always! An ordinary 'mailto' script looks something like this: Okay so far? Now we can add a pre-determined subject like this: You will have noticed that the additional parts (the subject) has been highlighted in red. Finally we add the 'body' part. ...and that's it! Be careful of two things.
I would suggest that you keep the 'Body' to something like 'please forward me more details', or something like that. At the bottom of every page on this website is a 'date last updated' script. This is a 'fire and forget' script in that it never needs to be looked at once it is in place. Here's how it looks: <CENTER>
That was easy wasn't it? All you have to do is copy and paste these few words where you want it to appear and that's it! Close Window Script This window can be closed by clicking here (don't forget, if you actually click this link say 'No' when your browser acts if you are sure!). A lot of people use this script and it's so easy to install and use. Simply place the following coding where you want it to appear on your page: The parts in red can be changed to read whatever you want. Dotted lines... Not exactly Javascript, but useful all the same. Have you ever noticed when you click on a link, and then go back to it, the link has an annoying little dotted line 'box' around it? Not sure what I mean? Click this link, it will open a small box which you can easily close again. Then look again at the link. Not only has it changed colour, which it's suposed to, but it has that silly 'box' around it. So how do you get rid of it? Here is the original code for the new mini-window: Now let's add a simple sentence - onfocus="this.blur()" So that it now reads: The new link is now - Click this link. Open the window again, then close it. Notice the difference? No dotted line around the link. I know it's only aesthetics, but I think it's a great idea and it can be used just about anywhere where you have a link - buttons, e.mail forms, checkboxes, radio buttons, graphics and so on. |