Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Accordion panel switching back to starting page after refresh

New Here ,
Sep 11, 2009 Sep 11, 2009

Copy link to clipboard

Copied

Hello,

I have an accordion widget with two panels. On the first panel is a welcome screen and on the second a user registration form. On this form I have server side validation. If the information entered fails the severside validation, the page refreshes, with the first panel open, which contains the welcome screen. Does anyone know how to keep the current open panel after a page refresh, so the user remians on the second accordion panel, which contains the form?

Any help would be fantastic,

Thank you.

TOPICS
Server side applications

Views

654
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Sep 11, 2009 Sep 11, 2009

The way to link to a specific Spry panel is described in this tutorial on my website: http://foundationphp.com/tutorials/spry_url_utils.php.

The tutorial deals with values pass through the URL, so only the basic principles apply to your scenario. When validating a form server-side, you'll be using the POST method, so you'll need to adapt everything to use conditional logic on the server side like this:

var Accordion1 = new Spry.Widget.Accordion("Accordion1", {defaultPanel: <?php if ($errors) { ech

...

Votes

Translate
LEGEND ,
Sep 11, 2009 Sep 11, 2009

Copy link to clipboard

Copied

The way to link to a specific Spry panel is described in this tutorial on my website: http://foundationphp.com/tutorials/spry_url_utils.php.

The tutorial deals with values pass through the URL, so only the basic principles apply to your scenario. When validating a form server-side, you'll be using the POST method, so you'll need to adapt everything to use conditional logic on the server side like this:

var Accordion1 = new Spry.Widget.Accordion("Accordion1", {defaultPanel: <?php if ($errors) { echo 1; } else { echo 0; } ?>});

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 11, 2009 Sep 11, 2009

Copy link to clipboard

Copied

LATEST

Hey David,

Thank you once again. As soon as I typed in what you suggested, it worked perfectly. . I only needed to slighty adjust the errors variable for my error array.

Have a good w/end,

Andrew.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines