Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BIG-19710 Fix add to wishlist nested forms #159

Closed
wants to merge 1 commit into from
Closed

BIG-19710 Fix add to wishlist nested forms #159

wants to merge 1 commit into from

Conversation

haubc
Copy link
Contributor

@haubc haubc commented Jul 8, 2015

Problem:

  • Nested forms
    When the user submits the form, it will only submit the parent form and not the child's.
  • Workaround
    Using javascript (similar to the legacy code) we submit a hidden form at a different location.

Other workarounds I thought of:

  • Use absolute position so the buttons can be next to each other, but that will cause responsive-layout issues.

@mickr @christopher-hegre @bc-miko-ademagic @SiTaggart

</div>
</div>
</fieldset>
</form>

<!-- Add to wishlist form -->
<form id="form-wishlish-add" method="post" action="{{product.add_to_wishlist_url}}">
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

id="form-wishlish-add" should be id="form-wishlist-add"

@SiTaggart
Copy link
Contributor

Personally, I dislike this, because it should work without JS enabled. In this instance the wishlist button will just submit the add to cart form which is confusing. More than happy to solve this with mark-up

@ghost
Copy link

ghost commented Jul 8, 2015

There's this:

<form method="get" action="something.php">
     <input type="text" name="name" />
     <input type="submit" id="submit-form" class="hidden" />
</form>

<label for="submit-form">Submit</label>

Never tested this method though. Also a bit dodgy, but probably better than a full JS solution.
There's also the html5 form attribute, but that has no IE support. Otherwise, it's CSS.

@haubc
Copy link
Contributor Author

haubc commented Jul 8, 2015

#sighmon has an idea he wants to test out, he will open another pr or commandeer this one. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants