Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Senior Coder BarrMan's Avatar
    Join Date
    Feb 2005
    Location
    Israel.
    Posts
    1,644
    Thanks
    69
    Thanked 83 Times in 82 Posts

    Make my web on top of everything/copy to clipboard

    I have a site just for me that gets information from the database and reveals it to me:
    1. i want the window to always stay on top of everything and not minimize itself when pressing on another application on the computer.
    2. there is a form that gets only one answer which i want it to automatically copy it to clip board.

    Is it possible?

    Thanks.
    Last edited by BarrMan; 12-18-2005 at 04:23 PM.

  • #2
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,467
    Thanks
    3
    Thanked 495 Times in 482 Posts
    i) suggest an iframe in a div

    2) access to clipboard IE only
    window.clipboardData.setData('Text',formobj.value);
    Last edited by vwphillips; 12-18-2005 at 04:29 PM.

  • #3
    Senior Coder BarrMan's Avatar
    Join Date
    Feb 2005
    Location
    Israel.
    Posts
    1,644
    Thanks
    69
    Thanked 83 Times in 82 Posts
    hi, Thanks for the reply!
    i don't know javascript so well... so can you broaden a little more? here is my code:
    Code:
    <%@ Language=VBScript %>
    <HTML>
    <HEAD>
    <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
    </HEAD>
    <BODY>
    <center>
    <%If Request.QueryString("m") = "addq" Then%>
    <form method="post" action="addq.asp">
    Question: <input size="100" type="text" name="q"><br>
    Answer: <input type="text" size="100" name="a"><br><br>
    <input type="submit" value="add question">
    </form>
    <%Else%>
    <form method="get" action="trivia.asp">
    question: <input name="q" type="text" size="100"><br><br>
    </form>
    <%
    If Request.querystring("q") <> "" Then
    Function strFormat(str)
        If IsEmpty(str) or IsNull(str) Then Exit Function
        Str = Replace(str,"<","&lt;")
        Str = Replace(str,">","&gt;")
        Str = Replace(str,"'","'")
        Str = Replace(str,"""","&quot;")
        Str = Replace(str,chr(13),"<br>")
        Str = Replace(str,"'","'")
        strFormat = str
    End Function
    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.Open "Provider=Microsoft.jet.oledb.4.0;Data source=" & Server.MapPath("db/db.mdb")
    Set Rs = Server.CreateObject("ADODB.RecordSet")
    Rs.Open "SELECT * FROM answers WHERE question LIKE '%" & strFormat(Request.querystring("q")) & "%'", Conn
    If rs.EOF Then
    Response.Write "No answers have been found<br><br>"
    Else
    Response.Write "<b>" & rs("answer") & "</b><br><br>"
    End If
    rs.Close
    Set rs = Nothing
    conn.Close
    Set conn = Nothing
    End If
    End If
    If Request.QueryString("m") = "alrdyexst" Then
    Response.Write "<font color=red>This question was already reported</font><br><br>"
    End If
    %>
    <a href="trivia.asp?m=addq"><b>add answer</b></a>&nbsp;&nbsp;<a href="trivia.asp?m=edq"><b>edit answer/question</b></a>
    </center>
    </BODY>
    </HTML>
    I want it to copy the answer to the clipboard and i want the window to be always shown.

  • #4
    Senior Coder BarrMan's Avatar
    Join Date
    Feb 2005
    Location
    Israel.
    Posts
    1,644
    Thanks
    69
    Thanked 83 Times in 82 Posts
    anyone knows?

  • #5
    Senior Coder BarrMan's Avatar
    Join Date
    Feb 2005
    Location
    Israel.
    Posts
    1,644
    Thanks
    69
    Thanked 83 Times in 82 Posts
    anyone? its quite ergant.


  •  

    Posting Permissions

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