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

Alan Lord alanslists at gmail.com
Fri Jan 20 14:53:04 GMT 2017


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?




More information about the vtigercrm-developers mailing list