javascript - jquery mobile slide out dialog box has previous leftover in it -


i have simple jquery mobile slide out dialog box, first time slide out works fine, comment box shows up, user can enter comments, submit, "thank you" follow.

but when user closes dialog box , slide out dialog box second time, "thank you" still there, want fresh comment box generated instead.

even when user enter in comment box without submit, , go back, next slide out dialog box still shows entered text!

any appreciated.

this html:

  <!doctype html>   <html>   <head>   <meta name="viewport" content="width=device-width, initial-scale=1">   <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.css">   <script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>   <script src="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js"></script>   </head>   <body>     <div data-role="page" id="pageone">       <div data-role="header">        <h1>welcome homepage</h1>      </div>       <div data-role="main" class="ui-content">        <p>click on link see slide effect.</p>        <a href="#pagetwo" data-transition="slide">slide dialog page</a>      </div>       <div data-role="footer">        <h1>footer text</h1>      </div>     </div>     <div data-role="page" data-dialog="true" id="pagetwo">       <div data-role="header">        <h1>thank you!</h1>      </div>       <div data-role="main" class="ui-content">        <form action="thankyou.asp" autocomplete="on">          comment:<input type="text" name="comment"><br>          <input type="submit" value="submit">        </form>        <a href="#pageone">go back</a>      </div>     </div> </body> </html> 

since never leave page have reset form manually using:

$("#form")[0].reset();


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -