Click to See Complete Forum and Search --> : box thing
tims15
05-03-2005, 12:23 PM
I now this is a really basic question but how do I create a box that pops up when someone clicks a link or button. You get them if you haven't filled in a form correctly when signing up for things. I know I haven't xplained it very well, so If you still dont know what I mean, create a new thread on these forums and and click Submit New Thread without adding any text (it will say you must enter a title/subject). (I just want it to unconditionally come up when clicking a button, for example, there could be a joke or quiz, and to get the answer the user clicks the button)
TheBearMay
05-03-2005, 12:42 PM
<button onclick="alert('Your Message Here');">Answer</button>
tims15
05-03-2005, 12:58 PM
Thanks for that,
What should I put when I want punctuation, like speech marks etc?
TheBearMay
05-03-2005, 01:02 PM
As long as you don't need single or double quotes you should be okay. If you need a double quote use \" and for a single quote or apostrophe use \' .
tims15
05-03-2005, 04:19 PM
It works without speech marks, but as soon as I put them in and put a \ infront of them it stops working. I've tryed leaving a space before the \" but it hasn't worked. Am I doing something wong?
tims15
05-03-2005, 04:30 PM
To get the speech marks I have put entities, which works fine.
The only other thing I can't do is have paragraphs. HTML just comes up as text and if I put in an enter into the text I get an error message saying 'Unterminated string constant' Is there something else which will enable me to have paragraphs/line breaks?
HaganeNoKokoro
05-03-2005, 04:31 PM
The alert should look something likealert("Line\nbreak");
tims15
05-04-2005, 08:31 AM
Thats all working perfectly now,
Thanks very much for all your help!