Skip to Content
0
Former Member
May 23, 2005 at 01:13 PM

Submitting HTMLB form using JavaScript

26 Views

Hi all,

Does anyone know how to submit an HTMLB form, using JavaScript? I want to check the form, through JavaScript, and send a confirmation to the user. If the user clicks OK in the JavaScript confirmation, I want the onClick method to run (In a sense, if the user clicks OK on the confirmation, I want the form to submit). Otherwise, if the user clicks Cancel on the confirmation, I want the form to clear.

Here is an example of what I am trying to do:

<script language="JavaScript">

function checkForm() {

var msg = "Are you ready to submit the form?";

var c = confirm(msg);

if (c) {

//submit the form

//I get an Object Expected error on this line.

htmlbEL(this,2,'btnSubmit:submitForm')

}

else{

//clear the form

clearForm();

}

}

</script>

...

<hbj:button

id="btnSubmit"

text="Submit"

onClientClick="checkForm()"

design="STANDARD"

jsObjectNeeded="true"

/>

Thanks in advance for the help!