简体   繁体   English

vtiger:如何在保存表单上设置字段value = 0?

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

Here code in edit.js : 这是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" , 基本上,我试图更改分配的用户,并且当我选择任何一个然后按保存按钮时,作为回报,我希望将nput field(time)值设置为“ 0”,

so to do this i wrote those lines in edit.js of my module. 为此,我在模块的edit.js中编写了这些行。 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 有关值,文本和html的更多信息,请参见下面的链接

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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