Is it possible to invoke action method directly from JavaScript funcation?
===

i want to invoke an **action method** when a special **JS validation** condition occurs (Had to validate with JS)

so what i am doing right now is as follows:

    function validateFrom() {
     var input = document.getElementById('myForm:input');  		
     var submitLink = document.getElementById('myForm:submitLink');
        			if(input.value.length==0){
        				submitLink.click();
        			}
        		
    		}

and the JSF:

    <h:commandLink  id="submitLink" action="#{myBean.doAction}"/>
    <h:commandButton value="Save" onclick="validateFrom();" />

and this works fine, but there's a small issue, is that if there's a JSF validation error like required="true" i can see that the preRender method is invoked twice, maybe because there are two click were done for the button and the link ? or maybe it's another problem with icefaces components ? 

i was wondering just for curiosity, if it's possible to call action method directly from JS ?