Hi!
Could you tell me, if this is correct:

onclick="javascript: if(!confirm('Confirm delete?')) return false;"

Many thanks ;)

Recommended Answers

All 6 Replies

you do realise that JavaScript and Java are not the same thing, do you?

Seemingly not.

Moved to the correct forum.

I dont see any problems with the snippet of code.
Are u getting any errors?

Thank you very much for the reply, Thirusha!!!
Unfortunately, yes - it just doesn't want to load it :( And i don't know what to do...

I have tested it on a button like this: (it works both in IE6 and FF3)

<input type="button" name="tbutton" id="tbutton" value="testbutton" onclick="javascript: if(!confirm('Confirm delete?')) return false;" />

It then pops up a confirmation box.

Can u provide your code, maybe something else is breaking first and thats why that part doesnt work.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.