Jump to content

Archived

This topic is now archived and is closed to further replies.

justin15

Text box, and make it display an error

Recommended Posts

I am working on the same contact me script for my website. I now want my script to do 2 things. I am pretty sure they can be done, and if you know how, please make it very simple.

The first one, I will try by myself but I'd say it will be something like using some varibles and the if and then statements.
What it is, To prevent spam, I want to make it so, if the " Name " and " Comments " section are not filled in, It will display a small pop saying that the following was not filled in.


The second, (I forgot my actually second idea ! [img src=\"style_emoticons/[#EMO_DIR#]/wink.gif\" style=\"vertical-align:middle\" emoid=\":wink:\" border=\"0\" alt=\"wink.gif\" /]) But I want to make it display beside the textbox is a thing in green letters saying how many Charcters you have left.

Thanks

Share this post


Link to post
Share on other sites
I think you'd be better off asking this in the JavaScript forum, from what you are describing, that is what you'll be needing. Topic moved.

Share this post


Link to post
Share on other sites
I dont know if it should be in here, but... Whatever helps I guess. I was thinkin the countdown part code be done in PHP.

Like make it so, It was take the part out of the code ... maxchar="20" or whatever, then subtract that from the amount you have typed in, which will display the number of letters left, once it reachs 20, it should display 0, and wont allow anymore typing

I think you should understand what I'm saying, but if you dont, Thats ok.

Share this post


Link to post
Share on other sites
Both of these can be done with javascript. Have a look over at [a href=\"http://dynamicdrive.com/\" target=\"_blank\"]dynamicdrive.com[/a] for some scripts.

Heres a [a href=\"http://dynamicdrive.com/dynamicindex16/requiredcheck.htm\" target=\"_blank\"]form validator[/a] and a [a href=\"http://dynamicdrive.com/dynamicindex16/maxlength.htm\" target=\"_blank\"]Maxlength script[/a] and [a href=\"http://dynamicdrive.com/dynamicindex16/limitinput.htm\" target=\"_blank\"]here is another[/a] - includes countdown

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.