SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot jammo's Avatar
    Join Date
    Dec 2003
    Location
    el paso tx
    Posts
    119
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    script that makes button disappear for 1 minute

    im looking for a script that cuases a SUBMIT button to disappear for ONE MINUTE after being pressed.

    i recently wrote a php script for image uploads.
    the php script renames the file based on the precise minute of upload. i have it down to the minute, so whenever i upload any 2 files withint the same minute, the second file will rename the first file.

    i wish to use this script on my site for member uploads.
    and need all files to be renamed, this the php rename thing i wrote.


    and to prevent someone from upload 2 files within a minute and having one file overwritten, i need a javascript that causes the SUBMIT button to disappear for one minute.


    anyone who can assist me, id be super grateful.

    << BTW: im a php/javascript newbie >>

  2. #2
    American't awestmoreland's Avatar
    Join Date
    Sep 2002
    Location
    Grand Rapids, MI
    Posts
    1,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Using Javascript to make the button disappear would be a doddle:

    1) Set the button's display attribute to "none".
    2) Create a Javascript function which sets the display attribute to "block" but call it using the setTimeOut method with a delay of 1 minute.

    However...

    This is only going to work for the current incarnation of the web page. The button will re-appear immediately if:
    1) The user hits refresh
    2) The user opens a second occurrence of the page in another browser session
    3) Another user visits the page from a different location

    If I were you, I'd consider renaming the file based on seconds (at least) and possibly also incorporate some other reference such as a random number suffix to ensure that it gets a unique name.


    Andy
    From the English nation to a US location.

  3. #3
    SitePoint Zealot jammo's Avatar
    Join Date
    Dec 2003
    Location
    el paso tx
    Posts
    119
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Posted by jammo - Yesterday at 22:08
    << BTW: im a php/javascript newbie >>

    thank you, ill try something and im sure ill get it.


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
  •