Search code examples
javascriptphpjqueryvtigercrm

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...


Solution

  • 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