#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    21
    Rep Power
    0

    Clear out the url parameters


    Hi,

    I want to clear out the form with default values. The fc below worked fine with clear out the values from the form. However, the url variables stills showing. How can I clear out all the url pramaters?

    For example, from the debug, it still shows when I click on Clear All button. How can I reset those url parameters to 0 ?
    URL Parameters:
    id=999
    type=cust


    Thanks

    //reset form
    function clear_form_elements(ele) {
    $(ele).find(':input').each(function() {
    switch(this.type) {
    case 'text':
    $(this).val('');

    }

    });
    }

    <cfinput onclick="clear_form_elements(this.form);reallyreset();name="reset" id="clear" class="button" type="button" value="Clear All" />
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2013
    Posts
    26
    Rep Power
    0
    Code:
    <!doctype html>
    <html lang="en">
    <head>
      <meta charset="utf-8">
      <title>demo</title>
      <style>
      </style>
      <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
    </head>
    <body>
    clears the text boxes<br>
    in the form<br>
    <input value="this will not be cleared">
    <form>
    <input value="Default">
    <input value="Default">
    <input onclick="clear_form_elements(form);" class="button" type="button" value="Clear FORM Text Boxes" />
    </form>
    <script>
    //reset form
     function clear_form_elements(ele) {
       $(ele).find(':input:text').val("");
     }
    </script>
    </body>
    </html>
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    21
    Rep Power
    0
    thanks, I have this code working fine with clear out the form variables but not url variables. How can I clear out the url variables as well?

IMN logo majestic logo threadwatch logo seochat tools logo