Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8310665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:32:36+00:00 2026-06-08T19:32:36+00:00

I have a question, actually two, concerning eric martins simple modal. What I try

  • 0

I have a question, actually two, concerning eric martins simple modal. What I try to do is that when somebody clicks a button the modal pop up and shows the different variants of that particularly product. This are checkboxes, so you can choose a color “green” red etc. Not just red or green. Further there are input fields where you can fill in the amount you want of that particularly color. So 1 or 20 or a million etc…

So far so good…. Problem is now that I need to send the filled in data and checked checkboxes back to the server. I actually don’t know how to do that.

So:
1) How can I check if a checkbox is actually checked?
2) How do I get values out of the input fields?
3) How do I send this data to the server?

What I have is:

$('.opener').click(function (event) {

 var url = $(this).attr("href")+'/?format=json';

 $('#formVariants').modal({ 

 onShow:function(dialog) {      

   $.getJSON(url, function(data) {           

     var contentHtml = '';

     $.each(data.product, function(index, product){

       var image = 'http://cdn.webshopapp.com/i/' + image_id_convert(data.product.image) + '/160x120x2/image.jpg';

       contentHtml = 
         '<img src="'+image+'"/>' +
         '<div class="variantsContainer">' +  
         '<h3>' + data.product.fulltitle + '</h3>';
       });

     $.each(data.product.variants, function(index, variant){

       //var variantId = ;
       //  " selected="selected"> - €0,00
       contentHtml = contentHtml + 
         '<div class="variants">' + 
         '<label><input type="checkbox" name="variant" value="' + variant.id + '"/>' + variant.title + '</label> ' +
         '<label style="float:right; margin-right:10px;">Aantal: <input type="text" name="quantity" id="formProductQuantity" value="1" /></label>';

       contentHtml = contentHtml +   
         '</div>';

     });

     $('#formProduct .formProductContent').html(contentHtml);

   });

 }
 });
 return false
 })

My HTML

    <div id="formVariants">
  <div class="formVariantsContent">
    <form class="formProduct" id="formProduct" action="{{ ('cart/add/' ~ product.vid ) | url }}" method="post">
      <div class="formProductContent"></div>
      <a class="button button grey simplemodal-close"><span>{{ 'Annuleren' | t }}</span></a>
      <a class="button blue opener" href="#" title="{{ 'Add to cart' | t }}"><span>{{ 'Add to cart' | t }}</span></a>
    </form>
  </div>
</div>

I’m pretty new to jquery and come this far, if anyone give me some advice I would be happy.

Thx.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T19:32:38+00:00Added an answer on June 8, 2026 at 7:32 pm

    Since you are using a form, when you submit it with method=”post”, it will send key value pairs of the form key=name value=value for your input fields. For example:

    <input type="text" name="quantity" id="formProductQuantity" value="1" />
    

    In your POST you will have [‘quantity’] = 1

    In the form action= causes a request to be sent to that url when the form is submitted.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It's actually two part question regarding my simple page (that will be replaced some
I actually have two questions regarding exception/error handling in the iPhone app that I
i have a very simple question, actually this is not the question, this is
Here is a question that I have had for some time but never actually
I actually have two questions, both are probably simple, but for some odd reason
I have a Dataset that contains tables from a university database, two(actually more) of
I have a question or actually two regarding the Convert.ToInt32 function or Int32.Parse .
I have a question about cloning within a loop, two problems actually and im
we have embedded the .NET WebBrowser control (actually two in different tabs, if that
Actually i have two questions. Question 1. I have made a style for a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.