ermouth / jQuery.my

jQuery.my is a plugin that reactively binds form controls with js data structures.

Home Page:https://jquerymy.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to set a value

fjnalhm opened this issue · comments

Hello, I changed value of an input by jQuery method, and the data doesn't changed. Then I found this in readme, but I can't get it. I can't change data by key or id, cause the input may in a list. Can you show me an example? Thank you!

...........................
To put new data into already initialized instance of $.my call $("#form").my("data", {name: "Mike"}). Note you can update data partially. Form is redrawn and revalidated after applying new data .

I can’t guess what you’ve written, provide code.

Due to compony network limit, I can't provide code. I want to preview an uploaded img, and set its url to data.
I upload a image file, then get a url, write it into next hidden input. After that, a img tag is watching on the input tag. While value of input tag is not null, the value will be set to src, and img stop hidden.
It doesn't work. Value of hidden get changed, but the json data didn't.

Sorry, can’t help without code.