www.webdeveloper.com
Results 1 to 3 of 3

Thread: reset page on refresh

Hybrid View

  1. #1
    Join Date
    Feb 2012
    Posts
    9

    Red face reset page on refresh

    Hi,
    I am not able to reset my text for a login page ie after the page gets refreshed the text entered still remains...my code:-

    <p>Name</p>
    <input type="text" name="name" id="name" style="width:200px; background-color:#CCC"/>
    <p>Email Address</p>
    <input type="text" name="email" id="email" style="width:200px; background-color:#CCC"/>

    The reset works for chrome..not for ie or firefox...please help anyone.
    Thanks,
    PR

  2. #2
    Join Date
    Mar 2011
    Posts
    1,136
    You could reset the fields with JavaScript with an onload() function.
    Rick Trethewey
    Rainbo Design

  3. #3
    Join Date
    Feb 2012
    Posts
    9

    yep i tried that...worked

    function reset2(myform)
    {
    document.forms[0].elements[0].value = "";
    document.forms[0].elements[1].value = "";
    document.forms[0].elements[2].value = "";
    document.forms[0].elements[3].value = "";
    return true;
    }


    and the html:-

    <body onload="return reset2()">

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles