Can anyone offer more help on this I have the code setup on jsfiddle at…
http://jsfiddle.net/justinerswell/feDTU/
I need to get the last item in the substr and work backwards to populate the fields I need.
Thanks
Original Question
Hi I have a list box returned on a page with multiple result which are being parsed in as a string into the value…
<option value="1 Corn Exchange, The Strand, RYE, East Sussex, TN31 7DB, UNITED KINGDOM">
Using JQuery I need to do a couple of things..
- Get Selected Value
- Split Value of Selected Item by Comma’s
- Loop through in revers and set a variable for each item i.e country: United Kingdom Postcode:TN31 7DB etc
Can anyone help me?
Thanks
Do you want to fetch the data on click or submit?
But its not a very good idea, considering your “data” structure can’t change (ie. missing fields and so on) – since it will break on the indexes….