Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
4300 Weergaven

I am in a case that I need to change a field value from outside the widget (Example Browser JS Console).

I have the input id and when I change its value it is not saved on form save.

I think that the field Widget do have some events that should be called in order for the value to be registered.

To reproduce the case try just to change any form input value from the browser dev tools (inspector) and you will notice that when you save the form the value will disappear.

Avatar
Annuleer
Beste antwoord

Hello Slim

i have just applied javascript to change value of phone field on contact form.

find id of your field where you want to change value

1)  check following field has id o_field_input_53 and value is 3331.


2) now i have changed phone value and it has been changed.

$('#o_field_input_13').val('3333')
$("#o_field_input_13").trigger("change");

3)  apply $("#o_field_input_13").trigger("change"); and save record 


Thanks & Regards,



CandidRoot Solutions Pvt. Ltd.

Mobile: (+91) 8849036209
Email: info@candidroot.com
Skype: live:candidroot
Web: https://www.candidroot.com
Address: 1229-1230, Iconic Shyamal, Near Shyamal Cross Road, Ahmedabad, Gujarat

Avatar
Annuleer

we have to apply trigger change event externally

$("#o_field_input_13").trigger("change");

what if the fields inside wizard? sometimes it's work and the rest is not

Auteur Beste antwoord

You are right this is sufficient, do you think is it possible to call widgets methods ? I think this can be helpful in other cases.

Avatar
Annuleer