I have a form with about 80 inputs in type text and select.
All input fields are related to css values. I want to show preview with new values (onChange any input value) in form without submitting form ( may be ajax will needed for this. Ajax with php can be ok.... I am newbie in this field)
Sample form code is as follows
<form id="myform">
<label>Container Background Color : </label>
<input type="text" name="container_bgcolor" value=""> // Using jscolor.js with readonly input to select color in html color code format
<label>Container Color : </label>
<input type="text" name="container_color" value="">
<label>Container Width : </label>
<select name="container_width">
<option value="">Select Width </option>
<option value="480">480 Px </option>
<option value="500">500 Px </option>
<option value="550">550 Px </option>
</select>
<input type="submit" value="Submit Form">
</form>
Now I want to show preview with input fields value. (Expecting OnChange Input Value)
CSS file sample : e.g. mystyle.css / mystyle.php (with header("Content-type: text/css; charset: UTF-8");)
.container {
background-color: {container_bgcolor}; /* New Value from input */
color: {container_color}; /* New Value from input */
padding: 10px; /* Fixed Value */
margin : auto; /* Fixed Value */
width : {container_width}px; /* New Value from input */
}
And in Div preview :
<div class="container"> // here above css will be applied
Rest Info....
</div>
Preview can be shown below form / in modal by clicking floating button click.
How can i achieve this ? Thank you in advance...