Hello, this is my first post to the group, so be gentle.  I recently
downloaded the Star Rating plugin and I've got a few questions that I
can't seem to figure out for myself.  If they are there in the
documentation, I apologize for not figuring them out for myself and I
will accept being called an idiot if someone will explain them to me.

I'm using asp.net with MVC.

At this time I will just ask just a couple of question so I don't look
quite so stupid.  If I don't get completely roasted then I'll probably
come back for some of the other things.

For one page I would like to present a star rating that has 5 stars
with the 3rd star as the default selected.  I can do this fine, but I
would like to hide, or at least disable the "Delete" choice.  In other
words if the page is submitted then I want the rating to be 1,2,3,4 or
5.   I don't want it to come back with no rating selected.

Here is the code:

            <td>
                <strong>
                    <label for="Rating">
                        Rating:</label></strong>
            </td>
            <td valign="top" width="180">
                <input name="rating" type="radio" class="star"
value="1" />
                <input name="rating" type="radio" class="star"
value="2" />
                <input name="rating" type="radio" class="star"
value="3" checked="checked" />
                <input name="rating" type="radio" class="star"
value="4" />
                <input name="rating" type="radio" class="star"
value="5" />
            </td>

The second question I have:  Is it possible to put multiple "Disabled"
star ratings on one page?   What I need to do is display a list of all
of the reviews for an entity in a list format.  I would like to show
the rating associated with each review and allow a user to click on
the specific review and see the detail of the review.  If I have 8
rows in the database, The foreach loop below displays 8x5 stars (40
stars in one line) across the first line and then displays the 8 lines
of details.

Here is the code for this:

    <table>
    <% foreach (var review in Model.Reviews)
       { %>
           <tr>
            <% if (!Model.IsSingleBusiness)
               { %>
                   <td>
                       <%= Html.ActionLink(Html.Encode(review.Title),
"Details", new { id = review.ReviewId, eId =
Model.Entity.EntityId })%>
                   </td>
             <% } %>
               <td valign="top">
                   <%= Html.ActionLink("Details", "Details", new { id
= review.ReviewId, eId = Model.Entity.EntityId })%>
                   <br />Rating: <%= Html.Encode(review.Rating)%>
                        <input name="rating" type="radio" class="star"
disabled="disabled" />
                        <input name="rating" type="radio" class="star"
disabled="disabled" />
                        <input name="rating" type="radio" class="star"
disabled="disabled" />
                        <input name="rating" type="radio" class="star"
disabled="disabled" />
                        <input name="rating" type="radio" class="star"
disabled="disabled" />
                   <br />By: <%= Html.Encode(review.Reviewer.FullName)
%>
               </td>
               <td valign="top">
                   <%= Html.ActionLink(Html.Encode(review.Title),
"Details", new { id = review.ReviewId, eId = Model.Entity.EntityId })
%>
               </td>
           </tr>
    <% } %>

    </table>

Thanks in advance for any help.

Robert Ladd

Reply via email to