HTML form with two submit buttons and two “target” attributes

前端 未结 15 2297
暗喜
暗喜 2020-11-29 20:02

I have one HTML

.

The form has only one action=\"\" attribute.

However I wish to have two different target=\"\" attribu

15条回答
  •  旧时难觅i
    2020-11-29 20:05

    Alternate Solution. Don't get messed up with onclick,buttons,server side and all.Just create a new form with different action like this.

    
    AC Hi-Side Pressure
    Engine Speed

    Now in Javascript you can get all the elements of main form in v() with the help of getElementsByTagName(). To know whether the checkbox is checked or not

    function v(){
    var check = document.getElementsByTagName("input");
    
        for (var i=0; i < check.length; i++) {
            if (check[i].type == 'checkbox') {
                if (check[i].checked == true) {
    
            x[i]=check[i].value
                }
            }
        }
    console.log(x);
    }   
    

提交回复
热议问题