LemonStand Forum: Standard Form error alert - LemonStand Forum

Jump to content

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

Standard Form error alert

#1 User is offline   neil.mills 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 43
  • Joined: 05-September 10

Posted 06 September 2010 - 04:38 AM

Hi,
is there a way to amend the way forms display errors. Would like to change the standard alert message if possible.
0

#2 User is offline   Aleksey 

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

Posted 06 September 2010 - 03:34 PM

Hi! This idea has already been suggested: http://forum.lemonst...rror-messaging/

We will implement some other way of displaying error messages.

Thanks!

#3 User is offline   neil.mills 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 43
  • Joined: 05-September 10

Posted 07 September 2010 - 07:56 AM

Quote

Hi! This idea has already been suggested: http://forum.lemonst...rror-messaging/

We will implement some other way of displaying error messages.

Thanks!


Hi, could you give me some pointers on how to extend the frontend js framework. Would like to experiment with it to see if i can get something working.

Many thanks.
0

#4 User is offline   Aleksey 

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

Posted 07 September 2010 - 03:15 PM

Quote

Hi, could you give me some pointers on how to extend the frontend js framework. Would like to experiment with it to see if i can get something working.


Hi!

I attached a JavaScript file. Put it to the resources/javascript directory and link it to your store pages after you call the <?= include_resources() ?>.

The JS file overrides the default AJAX error behavior. Instead of displaying an alert box, it outputs the error message to the browser's console. You can replace this behavior with anything else, for example with a jQuery FancyBox. Please bear in mind that you need to use jQuery noConflict() feature to avoid conflicts between jQuery and LemonStand JS framework. On this page you will find an example of displaying a popup window (fancybox) with a custom HTML content: http://fancybox.net/blog

jQuery.fancybox(
        xhr.responseText.replace('@AJAX-ERROR@', '').replace(/(<([^>]+)>)/ig,""),
        {
                'autoDimensions'    : false,
            'width'                 : 350,
            'height'                : 'auto',
            'transitionIn'        : 'none',
            'transitionOut'        : 'none'
        }
);


(you need to use jQuery instead of $ in noConflict mode). I didn't test this code, it could require some tweaking.

If course you need to link jQuery and Fancybox libraries before you can use them. You can find information about using jQuery with LemonStand on this page: http://lemonstandapp...ript_framework/

Thank you

#5 User is offline   liamegan 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 41
  • Joined: 13-August 10

Posted 21 February 2011 - 08:34 PM

I'm trying to accomplish the same thing but I can't find a decent example; did posts lose their attachments with the move to the new forum software?
0

#6 User is offline   Eric 

  • Developer
  • Group: +Administrators
  • Posts: 1,201
  • Joined: 04-August 10

Posted 22 February 2011 - 11:10 AM

View Postliamegan, on 21 February 2011 - 08:34 PM, said:

I'm trying to accomplish the same thing but I can't find a decent example; did posts lose their attachments with the move to the new forum software?


Hi liamegan. That's correct, attachments were lost, sorry for the trouble.

I've attached the file from Aleksey's last post.

Also, I've added the jQuery attachment back to this topic: http://forum.lemonst...n-dialog/#p6807

Attached File(s)



#7 User is offline   liamegan 

  • Member
  • PipPipPip
  • Group: Members
  • Posts: 41
  • Joined: 13-August 10

Posted 22 February 2011 - 11:56 AM

That's no problem at all. Thanks for reataching.
0

Share this topic:


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

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