How to get VALUE from FORM without Submitting it?

后端 未结 5 1162
隐瞒了意图╮
隐瞒了意图╮ 2020-12-01 23:06

I would like to get value from Form without submitting it, because the client have to choose the right type of house model to get the right form that fits the selected house

5条回答
  •  星月不相逢
    2020-12-01 23:33

    If you don't want to submit the form, use JavaScript to get the element. Or you can also use jquery to access the value. Make sure you put id = "something" and retrieve it using $('#something').val();

    if you want to use JavaScript,

    
    
    
    

    AJAX codes here

     $("#model").live("change", function () {
         alert("You choose " + $('#model').val());
     });
    

提交回复
热议问题