SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    Guru Bullschmidt's Avatar
    Join Date
    Apr 2002
    Location
    USA
    Posts
    524
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    "Save As" Button

    How can I have a "Save As" button (or link if that is easier) on my page which acts the same as if the user did File | Save As from the browser?
    Thanks!
    J. Paul Schmidt
    www.Bullschmidt.com - Freelance Web and Database Developer
    www.Bullschmidt.com/DevTip.asp - Classic ASP Design Tips

  2. #2
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    just made this for you, it will help you with the other ones, but i can't remember them all tho lol.

    PHP Code:
    <html>
    <
    head>
    <
    title>Untitled Document</title>
    <
    meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

    <
    script type="text/javascript">

      var 
    isReady false;

      function 
    doFunc(func)
      {
        if (
    document.execCommand)
        {
          switch (
    func
          { 
            case 
    "open"      'open';      break;
            case 
    "saveAs"    'saveAs';    break;
            case 
    "print"     'print';     break;

            case 
    "cut"       'cut';       break;
            case 
    "selectall" 'selectall'; break;

          }

          
    isReady?document.execCommand(x):alert('Internet Exlorer 4.0++');
        }
      }

    </script>

    </head>

    <body onload="isReady=true">
    <table width="87" border="0" cellspacing="0" cellpadding="4">
      <!--DWLayoutTable-->
      <tr bgcolor="#000000"> 
        <td height="27" colspan="2" valign="top"><font color="#CCCCCC">Lorem</font></td>
      </tr>
      <tr bgcolor="#CCCCCC"> 
        <td width="51" height="27" align="center" valign="middle">open&nbsp;</td>
        <td width="20" valign="top"><input type="radio" id="radio5" onClick="doFunc('open')"      /></td>
      </tr>
      <tr bgcolor="#CCCCCC"> 
        <td height="27" align="center" valign="middle">saveAs&nbsp;</td>
        <td valign="top"><input type="radio" id="radio4" onClick="doFunc('saveAs')"    /></td>
      </tr>
      <tr bgcolor="#CCCCCC"> 
        <td height="27" align="center" valign="middle">print.&nbsp;</td>
        <td valign="top"><input type="radio" id="radio3" onClick="doFunc('print')"     /></td>
      </tr>
      <tr bgcolor="#CCCCCC"> 
        <td height="27" align="center" valign="middle">cut&nbsp;</td>
        <td valign="top"><input type="radio" id="radio2" onClick="doFunc('cut')"       /></td>
      </tr>
      <tr bgcolor="#CCCCCC"> 
        <td height="27" align="center" valign="middle">selectall&nbsp;</td>
        <td valign="top"><input type="radio" id="radio" onClick="doFunc('selectall')" /></td>
      </tr>
    </table>
    </body>
    </html> 

  3. #3
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Whoah...

    DAMN fine job Andrew! That rules. Is it cross-browser?
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  4. #4
    SitePoint Enthusiast Jack Michaelson's Avatar
    Join Date
    May 2002
    Location
    Netherlands
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wo-hoow!

    That is VERY cool !
    Jack

  5. #5
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanx, let me know if you remember the other commands, all it is a matter of putting a few commands in such as find although that never seemed to work.

    I did try to find a list, but all I got was the regexp command with test and compile etc. Well it's not exactly cross browser as far as I know.

    ps there is a command for edit but even when i tried using this i got an error.
    Last edited by Andrew-J2000; May 31, 2002 at 11:07.


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
  •