need basic form help
Posted: 23 June 2007 07:02 PM   [ Ignore ]
Newbie
Rank
Total Posts:  12
Joined  2007-06-13

I’m sure I’ll get the hang of it soon but for now, I don’t know why the following code won’t work:

{exp:rating:form entry_id="{entry_id}" form_name="review" require_membership="no" admin_template="admin_template" anonymous="yes" status="open" return="{path=’rating/thanks’}"}

<select name="rating" onchange="document.review.Submit()">
<
option value="1">1</option>
<
option value="2">2</option>
<
option value="3">3</option>
<
option value="4">4</option>
<
option value="5">5</option>
</
select>
<
input type="submit" name="submit" value="submit" />
{/exp:rating:form}

that is, I get an error message: u
  * A name is required to submit ratings.
  * Your email address is missing.
I thought setting “require_membership” to “no” and “anonymous” to “yes” would allow anyone to rate an entry?

please advise.

thanks.

Profile
 
 
Posted: 25 June 2007 03:34 AM   [ Ignore ]   [ # 1 ]
Sr. Member
Avatar
RankRankRankRank
Total Posts:  336
Joined  2005-07-09

Make sure to use correct single/double quotes, and not “fancy” ones. This code is working for me:

{exp:weblog:entries limit="1"}

{title}

{exp
:rating:form entry_id="{entry_id}" form_name="review" require_membership="no" admin_template="admin_template" anonymous="yes" status="open" return="{path='rating/thanks'}"}

<input type="hidden" name="name" value="{screen_name}" />
<
input type="hidden" name="email" value="{email}" />

<
select name="rating" onchange="document.review.Submit()">
<
option value="1">1</option>
<
option value="2">2</option>
<
option value="3">3</option>
<
option value="4">4</option>
<
option value="5">5</option>
</
select>
<
input type="submit" name="submit" value="submit" />

{/exp:rating:form}
{
/exp:weblog:entries}

 Signature 

Ingmar Greil

Profile
 
 
Posted: 25 June 2007 09:32 AM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  12
Joined  2007-06-13

ah. i copied that code straight from the Docs…

Profile
 
 
Posted: 25 June 2007 09:53 AM   [ Ignore ]   [ # 3 ]
Sr. Member
Avatar
RankRankRankRank
Total Posts:  336
Joined  2005-07-09

So did I, I think… Anyway, the main thing is to get it to work smile

 Signature 

Ingmar Greil

Profile
 
 
Posted: 22 August 2007 01:14 AM   [ Ignore ]   [ # 4 ]
Newbie
Rank
Total Posts:  8
Joined  2007-07-30

Hello:

Unfortunately, I’m also getting the error (“email required”) when one is not signed in.

Here’s how to replicate the error message:

1. Make sure you are NOT logged in the site,
2. ALSO,  very importantly, make sure you are also NOT logged into even the EE control panel.
3. Now, goto vote. The error will appear, I believe.

I was also able to replicate the error Pirco above got, when I did the same thing, which is to leave out the following code:

<input type="hidden" name="name" value="{screen_name}" />
<
input type="hidden" name="email" value="{email}" />


I would love to know if your able to replicate the error given the above steps, and if you have any insights on how to get around this.

(Perhaps, is there way to do an IF statement, so that if no email is available, to fill it with a fake one?)

Thank you kindly,
Alec

Profile
 
 
Posted: 22 August 2007 10:17 AM   [ Ignore ]   [ # 5 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  736
Joined  2004-03-30

Alecander,

I would highly recommend requiring an email for rating submissions, but if you want to get around it, it’s an easy thing to do.

In your form, put a hidden field named ‘email’ with a valid email value above the actual visible email field. In the flow of the post variables that get sent to the server, if no email is submitted, there will still be the hidden field value picked up. If someone does submit an email, their value will override the hidden one since it occurs lower down in the post order.

mk

 Signature 

Mitchell Kimbrough

Profile
 
 
   
 
 
‹‹ Docs example      ranking by category ››