Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery stars and "If then" button link
    text
    copied!<p>My jquery/java skills are non-existant.... I need some quick help:</p> <p>My boss wants to have a form where customers write a review and stars for discounts then hit submit; if they select more than 3 stars it takes them to a separate page than someone who submitted a review with less stars. </p> <p>Is it possible to have a j query button that changes the link on the fly depending on stars chosen?</p> <p>I'm using the j query Star-rating plugin:</p> <pre><code> &lt;script type="text/javascript" src="../src/rating.js"&gt;&lt;/script&gt; &lt;link rel="stylesheet" href="../src/rating.css" type="text/css" media="screen" title="Rating CSS"&gt; &lt;script type="text/javascript"&gt; $(function(){ $('.container').rating(); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;h1&gt;&lt;a title="Full Documentation" href="http://irfandurmus.com/projects/jquery-star-rating-plugin/"&gt;jQuery Star Rating Plugin&lt;/a&gt;&lt;/h1&gt; &lt;section class="container"&gt; &lt;input type="radio" name="example" class="rating" value="1" /&gt; &lt;input type="radio" name="example" class="rating" value="2" /&gt; &lt;input type="radio" name="example" class="rating" value="3" /&gt; &lt;input type="radio" name="example" class="rating" value="4" /&gt; &lt;input type="radio" name="example" class="rating" value="5" /&gt; &lt;/section&gt; &lt;script type="text/javascript"&gt; if $('.container').rating(4,5) { echo "&lt;a href="eventual link&gt; Click here to receive your discount code&lt;/a&gt;" ; } else $('.container').rating(1,2,3) { echo "&lt;a href="eventual link&gt;Click here to recieve your discount code&lt;/a&gt;"; } &lt;/script&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload