mardi 28 avril 2015

If checkbox in a form is ticked add it to the resulting div class

I am using a Wordpress plugin called Multi Rating Pro. When a user submits a rating on the page the result appears in a separate div on the same page.

I want to (as simply as possible) insert my own checkbox into the rating form and if its ticked, output a value in the resulting div class.

For example, inside the rating form I would add something like -

<input type="checkbox" name="anon" value="yes"> Rate anonymously

Then in the resulting div I would be looking for the class of 'yes' to be added to the div if the checkbox was checked on submission, like -

<div class="rating-result yes"></div>

How would I go about doing this? I assume the way in which he form is submitted would play a part but am unsure of its workings...




Aucun commentaire:

Enregistrer un commentaire