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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:52:36+00:00 2026-06-12T06:52:36+00:00

I have two pages index.html and external.html.In index.html i have two text field. Inserting

  • 0

I have two pages index.html and external.html.In index.html i have two text field. Inserting some text in those text field and clicking on a button i goes to external.html page.This external.html page has one button linking to index.html. When in click in that button it moves me to index.html.

Now the problem is when i move from external.html to index.html, the text fields remainds its previous value. i wanted it to clear its previous value when coming to index.html page. How to do that, please help me.

index.html

<section id="firstpage" data-role="page">
    <header data-role="header" data-position="fixed">      
        <h1>First</h1>
    </header>

    <div data-role="content" >

    <script type="text/javascript" >
        $( function(){
            $( '#name_field' ).val( "" );

        });


        $(document).ready(function () {
          $('.clearme').focus(function() {
            $(this).val("");
          });
        });

    </script>


    <label for="name" >Name:</label>
    <input type="text" name="name" id="name_field" value="" class="clearme" placeholder="Enter Name"/>

    <label for="email">Email:</label>
    <input type="email" name="email" id="email_field" value="" placeholder="Enter Email Id" />

    <input type="submit" id="button" value="External Page" data-theme="b"  onclick="_gotopage( 'http://localhost/test/external.html' );"/>
    </div>

    <footer data-role="footer" data-theme="d" >    

    </footer>   
</section>

external.html

<section id="secondpage" data-role="page">
    <header data-role="header" data-position="fixed">      
        <h1>External</h1>
    </header>

    <div data-role="content" >

    <script type="text/javascript" >


    </script>
           <input type="submit" id="comment_enter_button" value="Index Page" data-theme="b"  onclick="_gotopage( 'http://localhost/test/index.html' );"/>
    </div>

    <footer data-role="footer" data-theme="d" >    

    </footer>   
</section>

script.js

function gotopage( gotopage )
{ 
  $.mobile.changePage($( gotopage ), { transition: "slide"});
}



function _gotopage( page )
{
  $.mobile.changePage( page);
}
  • 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-12T06:52:37+00:00Added an answer on June 12, 2026 at 6:52 am

    Is something like this what you’re looking for?:

    $(document).on('pageshow', function () {
        $('.clearme').val("");
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two pages: index.html and main.html When i set the main.html page to
I have a simple jQueryMobile index.html page. Within that I have two pages using
I have two html pages one index.html and groups.html each page as ul >
lets say i have two pages links.html & contents.php ... first page contains only
1) We have a page index.html with blocks: <body> <div id=action1>One</div> <div id=action2>Two</div> <div
Here is my set up... I have two pages, index.html and cart.html. I have
I have two pages, on the first page after an event happens I change
I have two pages that inherit from one master page, First.aspx or second.aspx. Navigation
Currently I have two pages: The first page contains an input form, and the
I have a page named index.html . On it, I have a menu with

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.