简体   繁体   中英

populate form input fields from xml string

I have a form with inputs inside my page , i want to fill these fields with values of an xml string. the xml tags are the id's of the inputs.

how can i populate the form inputs from that xml string?

UPDATE: This is myy xml tags:

<Main><row><sheet_number>1</sheet_number><created_by>aa        </created_by><created_at>2011-02-13</created_at><updated_by>bb        </updated_by><updated_at>2011-02-13 13:24:39.481057</updated_at><type>0</type>

Thank's In Advance.

Do you know the tags/IDs or are they generated/random? If they are constant, you could use this http://papermashup.com/parse-xml-with-jquery/

Instead of adding HTML, just set the values of your input elements using jQuery's .val(value) method: http://api.jquery.com/val/#val2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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