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 8987811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:52:49+00:00 2026-06-15T21:52:49+00:00

I have a collapsible (enter your credit card info) form. When I click it

  • 0

I have a collapsible (enter your credit card info) form. When I click it it opens, but when I click submit I want it to close. Here’s my html:

<div class= "addStuff">
<div data-role="collapsible" data-inset="true" id="ccdiv">
   <h5> New credit card</h5>         
      <div data-role="fieldcontain">
            <form id = "myForm">
        <input type="password" name="credit_card_number" id="credit_card_number" value="" placeholder="Credit Card Number">
        <input type="password" name="security_code" id="security_code" value="" placeholder="Security Code">
        <input type="date" name="expiration_date" id="expiration_date" value="" placeholder="Expiration Date">
        <input type="password" name="name" id="name" value="" placeholder="Name On Card">
        <input type="password" name="street_address" id="street_address" value="" placeholder="Street Address">
        <input type="text" name="city" id="city" value="" placeholder="City">
        <input type="number" name="zip_code" id="zip_code" value="" placeholder="Zip Code">

            <button type="button" class="submit" name="submit" value="submit">Submit</button>
            </form>
      </div>
</div>

And here is my JS attempt:

$(document).ready(function() {
$('.submit').click(function(){
    var creditcard = $('#credit_card_number').val();
    $('.accounts #CreditCards div[data-role="content"] #swipeMe').append('<li data-swipeurl="#" ><a href="#">' + creditcard + '</a></li>');
   // refresh view 
   $('#CreditCards ul').listview('refresh');

   // hide form
 alert('test'); 


 $('#myForm').slideUp();
 $('#myForm').trigger('collapse');

    });
});
  • 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-15T21:52:50+00:00Added an answer on June 15, 2026 at 9:52 pm

    Here is a link to a JsFiddle I worked on to try and get your code working
    http://jsfiddle.net/rvqRX/

    I went thru line by line and commented each one out one at a time and found that the only line I had to comment out for it to behave correctly was this

    $('#CreditCards ul').listview('refresh');
    

    Not sure why… does it make any sense to you?

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

Sidebar

Related Questions

I have a sidebar with collapsible menu it works fine but all the values
I have a jquery-ui accordion widget with the setting collapsible:true . I want other
I have this menu: items:[ { xtype: 'form', id: 'searchPanel', title: 'Search', collapsible: true,
I have a collapsible section that I want to add an image and a
I have made a collapsible fieldset, but I have multiple fieldsets on the same
I have a problem with the execution of JavaScript within a collapsible-set. I want
I have a set of divs that I want to make collapsible/expandable using jQuery's
I have two group boxes, the top one is collapsible. I want to adjust
Is it possible to have a collapsible menu in a fragment, say for example...
I have a Jquery Mobile collapsible set , which can have any number of

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.