/    Sign up×
Community /Pin to ProfileBookmark

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)

to post a comment
Full-stack Developer

7 Comments(s)

Copy linkTweet thisAlerts:
@TheBearMayMay 03.2005 — <button onclick="alert('Your Message Here');">Answer</button>
Copy linkTweet thisAlerts:
@tims15authorMay 03.2005 — Thanks for that,

What should I put when I want punctuation, like speech marks etc?
Copy linkTweet thisAlerts:
@TheBearMayMay 03.2005 — 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 ' .
Copy linkTweet thisAlerts:
@tims15authorMay 03.2005 — 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?
Copy linkTweet thisAlerts:
@tims15authorMay 03.2005 — 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?
Copy linkTweet thisAlerts:
@HaganeNoKokoroMay 03.2005 — The alert should look something likealert("Line[color=red]n[/color]break");
Copy linkTweet thisAlerts:
@tims15authorMay 04.2005 — Thats all working perfectly now,

Thanks very much for all your help!
×

Success!

Help @tims15 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.24,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...