...

View Full Version : Help with confirm code



Wobbler
10-04-2003, 07:56 PM
Can anyone fix thís code,


function SubmitContent() {


if (document.editor.subject.value == "") {
var x=window.confirm("Du har inte angett en ämne.\nVill du fortsätta ändå?")

if (x) {
document.editor.MAIL.value = idContent.document.body.innerHTML;
document.editor.SEND.disabled = true;
return true;
}
else {
document.editor.subject.focus();
return false;
}
}
else {
document.editor.SEND.disabled = true;
document.editor.MAIL.value = idContent.document.body.innerHTML;
return true;
}

thanks in before

beetle
10-04-2003, 08:00 PM
What's wrong with it? I could guess, but I'd most likely waste both our time doing so.

Wobbler
10-04-2003, 10:05 PM
well I tried many kind of sokutions, but on all it doesn't matter if you press OK or Cancel, Both will submit the form

beetle
10-04-2003, 11:20 PM
Well, I suppose I'll have to guess.

Maybe you have something like this

<form name="editor" onsubmit="SubmitContent()">

But it isn't working -- so you need to change it to this

<form name="editor" onsubmit="return SubmitContent()">

Am I right?

Wobbler
10-05-2003, 12:26 PM
Maaan you're god :D:D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum