SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2006
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    problem in javascript

    this is javascript code for resetting the form. this is working on IE but not firefox. what is the problem?
    <P align=left> <a href="#" onclick="document.getElementById('form1').reset()">
    <img src="images/reset.gif" width="86" height="26" class="bob24"></a>

  2. #2
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,424
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    Why don't you just use HTML's built in reset button?

  3. #3
    SitePoint Enthusiast
    Join Date
    Jan 2006
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it's my compusion to use javascript refersesh , kindly advsie me

  4. #4
    SitePoint Enthusiast
    Join Date
    Jan 2006
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by kingkong
    this is javascript code for resetting the form. this is working on IE but not firefox. what is the problem?
    <P align=left> <a href="#" onclick="document.getElementById('form1').reset()">
    <img src="images/reset.gif" width="86" height="26" class="bob24"></a>
    Nothing. Works fine in Firefox (windows & Mac). Are you sure you have named your form "form1"? Perhaps you are using an older version of Firefox. I tested in both Mac & PC: FF 1.5.0.1

  5. #5
    SitePoint Evangelist Will Kelly's Avatar
    Join Date
    May 2005
    Location
    London
    Posts
    475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I suspect you haven't given the form the id.

    HTML Code:
    <form id="form1">
    not
    HTML Code:
    <form name="form1">

  6. #6
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    just do this:
    <BUTTON name="reset" type="reset">
    <img src="images/reset.gif" width="86" height="26" class="bob24">
    </BUTTON>


Bookmarks

Posting Permissions

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