jquery - How to make live preview based on information entered in a form? PhP/ajax? -
jquery - How to make live preview based on information entered in a form? PhP/ajax? -
i'm working on 1 project , handy implement "live preview" feature in it. problem is not kind of typed text preview "e.g. 1 on stackoverflow when create question". working on different. example, have form inputs (background color, padding value, margin value etc...) each time user updates 1 of inputs wan't show preview of updated object next form, lets object div styled basing on user entered in form.
how can accomplish feature?
jquery based solution preferable.
edit: how form looks
<form id="div_builder"> <input type="text" name="background_color"/> <input type="text" name="padding"/> <input type="text" name="margin"/> </form>
not testet should work (with jquery)...
<form id="div_builder"> <input type="text" name="background-color"/> <input type="text" name="padding"/> <input type="text" name="margin"/> </form> <div id="object"><img src="some object" /></div> <script type="text/javascript"> $('#div_builder input').change(function(){ var css = $(this).attr("name"); $("#object").css(css,$(this).val()); }) </script>
php jquery html css ajax
Comments
Post a Comment