[Vtigercrm-developers] vt7: How to update field from Javascript

Susruthan Seran susruthanz at gmail.com
Fri Jan 20 15:19:44 GMT 2017


Try this..

jQuery('input[data-name="svc_charges"]').attr('data-displayvalue',100);


On 01/20/2017 08:23 PM, Alan Lord wrote:
> On 20/01/17 14:36, Susruthan Seran wrote:
>> Hi Alan
>>
>> Is that a input?
>
> Yes. In vt7 the fields (in DetailView at least) are marked up like this:
>
>> <td class="fieldValue " id="LSSvcSVS_detailView_fieldValue_svc_charges">
>>   <span class="value" data-field-type="currency">
>>     <span class="currencyValue">0</span>
>>   </span>
>>   <span class="hide edit pull-left">
>>   <input class="fieldBasicData" data-name="svc_charges" 
>> data-type="currency" data-displayvalue="0" data-value="0.00" 
>> type="hidden">
>>   </span>
>>   <span class="action pull-right">
>>     <a href="#" onclick="return false;" class="editAction fa fa-pencil">
>>     </a>
>>   </span>
>> </td>
>
> Al
>
>> On 01/20/2017 07:26 PM, Alan Lord wrote:
>>> What's the "trick" to update/alter the value of a field using 
>>> Javascript?
>>>
>>> I Detailview I am trying something like:
>>>
>>>> jQuery('input[data-name="svc_charges"]').data('value', myNewValue);
>>>
>>> But the attributes do not seem to be updating and nor is the span with
>>> the display value in it?
>>>
>>> is there something I need to "trigger" to get this to update?
>
>
> _______________________________________________
> http://www.vtiger.com/



More information about the vtigercrm-developers mailing list