开发者

how to set action attribute of the html:form according to javascript conditions written below

开发者 https://www.devze.com 2023-01-15 08:50 出处:网络
function setReqcode(id,methodName){ if(document.getElementById(\'approve\').value==id) { alert(\"inside approve\"+methodName);
 function setReqcode(id,methodName){

    if(document.getElementById('approve').value==id)
    {
        alert("inside approve"+methodName);
        action="ProcessPath.do?reqCode=approveVersion";
    }

    if(document.getElementById('reject').value==id)
    {
        alert("inside reject"+methodName);
        action="ProcessPath.do?reqCode=rejectVersion"
    }
}

i have to change the html:form action attribute according to if c开发者_开发知识库ondition. so please suggest some solution with example.


formReference.setAttribute('action', 'blah') 

or

formRef.action='foo'

should suffice.

0

精彩评论

暂无评论...
验证码 换一张
取 消