简体   繁体   中英

vtiger : how to set field value=0 on save form?

Here code in edit.js :

checkmytime : function(form){
    var thisInstance = this;
    var accountName = thisInstance.getAccountName(form); // current time value
    var cc = jQuery('select[name="assigned_user_id"]').prop('selected', true).trigger('change').val();

    if(!cc =='selected',true){
    var bb = jQuery('input[name="time"]').attr('value','0').val();
    return bb;
    }
},

I want to operate this function when i click on save button.

Basically i am trying to change my assigned user, and also when i select any and then press save button, in return i want nput field(time) value set to "0" ,

so to do this i wrote those lines in edit.js of my module. But still i need help to perform this process on save ,

any one please guide me if have any idea regarding this issue...

its pretty simple.. try with below.

 $("button").click(function(){
    var bb = $("#time").val(0);
 });

And for more info related to value, text and html see below link

http://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_dom_html_set

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM