Jump to content


Photo

Text box, and make it display an error


  • Please log in to reply
4 replies to this topic

#1 justin15

justin15
  • Members
  • PipPip
  • Member
  • 11 posts

Posted 11 June 2006 - 10:51 AM

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

#2 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 11 June 2006 - 11:52 AM

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.

#3 justin15

justin15
  • Members
  • PipPip
  • Member
  • 11 posts

Posted 11 June 2006 - 01:24 PM

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.

#4 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 11 June 2006 - 04:03 PM

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

#5 justin15

justin15
  • Members
  • PipPip
  • Member
  • 11 posts

Posted 11 June 2006 - 09:46 PM

Hey thanks, that should be useful !




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users