LemonStand Forum: Review form question - LemonStand Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Review form question

#1 User is offline   aki 

  • Member
  • Group: Members
  • Posts: 10
  • Joined: 26-December 10

Posted 26 December 2011 - 04:07 PM

I have some questions about implementing a review form. I have reviewed the pages http://lemonstandapp...ng_and_reviews/ and http://lemonstandapp...dproductreview/ about implementing a custom review form, and I made sure I have the required fields: rating, review_title, review_author_name, review_author_email, and review_text.

- How can I check for empty fields upon submission? The doc has an onClick function for the submit button: onclick="return $(this).getForm().sendRequest(...), but this function doesn't check for empty fields. How can I accomplish this?

- This is my submit button:

<input type="submit" value="Submit Comment &raquo;" onclick="return $(this).getForm().sendRequest(
            'shop:on_addProductReview', {
              extraFields: {no_flash: true},
              update:{'product_page': 'product_partial'
            }})" />


But when "submit" is clicked with all fields filled, instead of getting a response of some sort for success/failure, I get a long URL back and the review is not added. The URL is: example.com/product/test-product?review_author_name=john&review_author_email=noreply%40example.com&review_title=test+review&rating=3

How can I debug this and find out what's going on when the review is submitted?

- Lastly, is there no way to manually add reviews?

Thanks!
0

#2 User is offline   Aleksey 

  • Co-Founder
  • Group: +Administrators
  • Posts: 3,631
  • Joined: 31-October 09

Posted 27 December 2011 - 02:44 PM

Hi!

The manual review adding is planned.

Please try to replace "submit" input type with "button". It is likely that when you click the button it submits the form with the regular GET method. You can alternatively handle the onsubmit form event if you want, like we do in our Simplicity theme: http://themes.lemons...lemony-product/ (click "Write a review" to see the review form).

Thank you

#3 User is offline   aki 

  • Member
  • Group: Members
  • Posts: 10
  • Joined: 26-December 10

Posted 22 January 2012 - 06:53 PM

View PostAleksey, on 27 December 2011 - 02:44 PM, said:

Please try to replace "submit" input type with "button".


Thanks for the suggestion Aleksey! I think that worked. However, I am now getting a "$(this).getForm() is not a function" javascript error. I followed this page (http://lemonstandapp..._and_css_files/) and added the necessary resources in my template in <head>, as follows:

<?= $this->js_combine(array(
        'mootools',
        'ls_core_mootools')) ?>
<?= $this->js_combine(array(
        'jquery',
        'ls_core_jquery')) ?>
<?= $this->css_combine(array('ls_styles')) ?>


I also checked to make sure that the files are indeed included in the generated HTML:

<script type="text/javascript" src="/ls_javascript_combine/?file%5B%5D=mootools&amp;file%5B%5D=ls_core_mootools"></script>
<script type="text/javascript" src="/ls_javascript_combine/?file%5B%5D=jquery&amp;file%5B%5D=ls_core_jquery"></script>
<link rel="stylesheet" type="text/css" href="/ls_css_combine/?file%5B%5D=ls_styles" />


But when I click the submit button for the review form, I still get "$(this).getForm() is not a function". What else could I be missing?

Thank you.
0

#4 User is offline   Aleksey 

  • Co-Founder
  • Group: +Administrators
  • Posts: 3,631
  • Joined: 31-October 09

Posted 23 January 2012 - 04:55 PM

Hi!

You should use either MooTools or jQuery frameworks, not both. Please remove this part if you want to use jQuery:

<?= $this->js_combine(array(
        'mootools',
        'ls_core_mootools')) ?>


Thank you

#5 User is offline   aki 

  • Member
  • Group: Members
  • Posts: 10
  • Joined: 26-December 10

Posted 23 January 2012 - 09:19 PM

Thanks again for the suggestion. I tried removing one of the includes but unfortunately I'm still seeing the error "$(this).getForm is not a function".

This is my PHP:

<?= $this->js_combine(array(
                'jquery',
                'ls_core_jquery')) ?>


And this is the generated HTML:

<script type="text/javascript" src="/ls_javascript_combine/?file%5B%5D=jquery&amp;file%5B%5D=ls_core_jquery"></script>


Any other ideas?
0

#6 User is offline   Aleksey 

  • Co-Founder
  • Group: +Administrators
  • Posts: 3,631
  • Joined: 31-October 09

Posted 24 January 2012 - 02:52 PM

Hi,

Does your server run on Windows? If so, please try to update LemonStand. We fixed a Windows-related bug in the resource combiner yesterday.

If it doesn't help, please post your store URL. If you can't post it on the forum, please submit a support ticket.

Thank you

Share this topic:


Page 1 of 1

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users