Hi,
I have a rather long form that I don't want people submitting unless
they are absolutely sure they are ready.
I figured the easiest way to prevent an accidental form submission by
way of hitting of the enter key was to simply not have a submit button,
instead going for a regular anchor which calls a javascript confirmation
box and then submits the form.
To do this, I have one function, and an anchor that calls it:
function submitConfirm()
{
var submitConfirmed = confirm("Are you ready to submit this form?");
if( submitConfirmed == true )
{
document.survey Form.submit();
}
....
}
<a href="#" onclick="submit Confirm()"><img src="submitBtn. png"
alt="Submit"></a>
All works fine in Mozilla and IE, but Konqueror doesn't behave as
expected. Instead of submitting the form, the anchor (in this case,
'http://my.site/BrokenSurvey.ht ml#') is loaded instead.
I tried it using getElementsByNa me, but with the same result.
Am I doing something wrong, or is it time to file a bug report with the
KDE folks?
thanks,
Greg
I have a rather long form that I don't want people submitting unless
they are absolutely sure they are ready.
I figured the easiest way to prevent an accidental form submission by
way of hitting of the enter key was to simply not have a submit button,
instead going for a regular anchor which calls a javascript confirmation
box and then submits the form.
To do this, I have one function, and an anchor that calls it:
function submitConfirm()
{
var submitConfirmed = confirm("Are you ready to submit this form?");
if( submitConfirmed == true )
{
document.survey Form.submit();
}
....
}
<a href="#" onclick="submit Confirm()"><img src="submitBtn. png"
alt="Submit"></a>
All works fine in Mozilla and IE, but Konqueror doesn't behave as
expected. Instead of submitting the form, the anchor (in this case,
'http://my.site/BrokenSurvey.ht ml#') is loaded instead.
I tried it using getElementsByNa me, but with the same result.
Am I doing something wrong, or is it time to file a bug report with the
KDE folks?
thanks,
Greg
Comment