0 Replies Latest reply on Jun 23, 2010 5:52 AM by Gregory Nikle

    How to submit form via js?

    Gregory Nikle Apprentice

      Hi,
      I've js function which submits Seam/JSF form on onclick event to prevent double click.



      function submitRequest(element) {
           try {
                if (requestSubmitted == false) {
                     element.disabled  = true;
                     element.value     = msg;
                     
                     requestSubmitted = true;          
                     var myForm = document.getElementById(element.form.id);
                   myForm.submit();
                     return true;
                } else {
                     alert('Form has been already submited...');
                }
                return false;
           } catch (err) {
                alert(err);
           }
      }



      but this form doesn't work for commandButtons in iterated list for @DataModel.
      Does anybody know to change/fix this code to submit selected button in iterated list on JSF page?