Jump to content

Text box, and make it display an error


justin15

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
Link to comment
https://forums.phpfreaks.com/topic/11702-text-box-and-make-it-display-an-error/
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.
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

Archived

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

×
×
  • Create New...

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.