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

  • Home
  • SEARCH
  • 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 8146471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:00:51+00:00 2026-06-06T14:00:51+00:00

I have a situation where the forms on my page disappear after a single

  • 0

I have a situation where the forms on my page disappear after a single submission of each form. For example, a log-in prompt displays (using Jquery Mobile) for username and password, the dialog box displays normally, the input is processed and validated, the main page is displayed upon successful login. However, if I logoff and then attempt to log back in again, only the page header is displayed. The input fields and the labels are not there.

I have another page where there is a single input field, text is entered into it, the $.post call is made, HTML is returned and a element is updated with the results using the $(‘#results’).html(dataReceived) function call.

The form seems to be disappearing when the results are displayed. This is the page text:

<div data-role="page" id="Search" data-title="Search">
<div data-role="header" data-theme="e">
<h1>Search</h1>                
</div>
<div data-role="content">                
<form name="SearchForm" action="search.php">
SSN: <input type=number name="snum" size="9" value=""><br>
<input id="SearchButton" type="submit" value="Begin Search" data-inline="true">
</form>
<div id=SearchResults></div>
</div><!-- /content -->
</div><!-- /Search -->

I intercept the submit event of the form and handle it somewhere else. The code that sets the div contents in the call back function of the $.post AJAX call is:

$('#SearchResults').html(dataReceived);

General information: Most recent stable version of jquery and jquery mobile. This is a multi-page file. No external pages are called. Everything is done with $.post calls. The login form does not update any HTML, it simply receives the ID of the user and stores it in a variable.

Any help would be appreciated. Google has not been my friend in this.

Amended to show form submission code:

$(document).ready(function() {
        $('form').submit(function(event) {
                event.preventDefault();
                var thisForm=$(this);
                var formUrl=thisForm.attr('action');
                var formName=thisForm.attr('name');
                var dataToSend=thisForm.serialize();
                var callBack=function(dataReceived) {
                        thisForm.hide();
                        switch(formName) {
                            case 'loginForm':
                            if (dataReceived.length>0 && parseInt(dataReceived)>0) {
                                   loggingIn=0;
                                   userId=parseInt(dataReceived);
                                   $.mobile.changePage("#home");
                                   break;
                            }
                            thisForm.show();
                            break;

                            case 'SearchForm':
                                    $('#SearchResults').html(dataReceived);
                                    break;
                        }
                };
                dataToSend += '&seid=' + SESSID;
                var rtnType="html";
                switch(formName) {
                        case "loginForm":
                                rtnType="text";
                                break;
                        case 'SearchForm':
                                break;
                }
                $.post(formUrl,dataToSend,callBack,rtnType);
                return false;
        });
  • 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-06T14:00:53+00:00Added an answer on June 6, 2026 at 2:00 pm

    You are hiding your forms on the submit callback function:

    thisForm.hide();
    

    For “loginForm” you are calling show() but for the “SearchForm” you are not calling show() on the form:

                var callBack=function(dataReceived) {
                        thisForm.hide();
                        switch(formName) {
                            case 'loginForm':
                              if (dataReceived.length>0 && parseInt(dataReceived)>0) {
                                   loggingIn=0;
                                   userId=parseInt(dataReceived);
                                   $.mobile.changePage("#home");
                                   break;
                              }
                              thisForm.show();
                              break;
                            case 'SearchForm':
                              $('#SearchResults').html(dataReceived);
                              break;
                        }
                };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this situation: There are a login page with a login form (form
So, I have next situation: I have a page with form -> this form
Here's my situation. I have a web forms page, and it's getting annoying when
I have a situation where i have to take input(form) from user. After continue
I have situation like this: user submits form with action='/pay' in '/pay' I have
I have a situation where validating a HTML form with jQuery Validation Plugin 1.9.0.
I have a situation where I need to concatenate several string to form an
I have following Situation, Server A sends some data (HTML form) to server B,
I have a unique situation over here. I have a button on a form
I have a simple situation here. lets face html code first => <form name=geoKey

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.