jQuery/PHP: Passing lots of PHP data to JS
Posted: Wed Apr 27, 2011 8:47 am
Hi guys,
I posted a thread about a dynamic form, but my question was probably too big and vague, so I've narrowed it down.
I'll have a dynamic form with lots of checkboxes/radio buttons, to be used for choosing what options you want to buy. When you tick one box, jQuery will query the PHP file, which processes those options have been selected so far. Eg, you tick 'Box 1', and the price of 'Box 2' gets discounted.
So I want to find the cleanest way for PHP to return enough information through jQuery, so that the prices on the user form can all be updated. Does anybody have any suggestions? How would I go about returning a full JS array which I can then use to refresh all of the data?
Thanks!
Robert
I posted a thread about a dynamic form, but my question was probably too big and vague, so I've narrowed it down.
I'll have a dynamic form with lots of checkboxes/radio buttons, to be used for choosing what options you want to buy. When you tick one box, jQuery will query the PHP file, which processes those options have been selected so far. Eg, you tick 'Box 1', and the price of 'Box 2' gets discounted.
So I want to find the cleanest way for PHP to return enough information through jQuery, so that the prices on the user form can all be updated. Does anybody have any suggestions? How would I go about returning a full JS array which I can then use to refresh all of the data?
Thanks!
Robert