...

View Full Version : Why won't it submit?



tyler jones
07-23-2002, 05:05 PM
I am constantly having problems using javascript to submit a form. Here's a very simple example that just won't work and I can't figure out why. Anyone? Thanks.



<form method="post" action="deleteQuestionaire.asp" name="deleteQn">
<input type="hidden" name="QnId">
</form>

<script language="javascript">
<!--
var deleteMessage = "Are you sure you want to do this?"

function deleteQuestionaire( QnId )
{
if ( confirm(deleteMessage) )
{
document.deleteQn.QnId.value = QnId;
document.deleteQn.submit();
}
}
//-->
</script>

<a href="javascript:void(0);" onClick="deleteQuestionaire('5');"><font size="1">Delete</font>

ACJavascript
07-23-2002, 08:26 PM
What happend was you placed spaces between the ( ) { functions.

You had: deleteQuestionaire( QnId )
is should be deleteQuestionaire(QnId)

same with the confirm. :D:D
Somehting as simple as that, doesn't that just get you mad!:D:D

------


<form method="post" action="deleteQuestionaire.asp" name="deleteQn">
<input type="hidden" name="QnId">
</form>
<script language="javascript">
<!--
var deleteMessage = "Are you sure you want to do this?"
function deleteQuestionaire(QnId){
if (confirm(deleteMessage)){
document.deleteQn.QnId.value = QnId;
document.deleteQn.submit();
}
}
//-->
</script>



<a href="javascript:void(0);" onClick="deleteQuestionaire('5');"><font size="1">Delete</font>


------


HappyScripting :D:D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum