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.
Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    New Coder
    Join Date
    Mar 2003
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Buttons.. Pls help...

    I got this code.... it only runs when i put in these buttons

    <form method="post" action="display_form.asp" target="_blank">
    <input type="hidden" name="vReqNo" value="<%=ReqNo%>">
    <input type="hidden" name="vAppnId" value="<%=vAppnId%>">
    <input type="hidden" name="vreqTitle" value="<%=vreqTitle%>">
    <input type="hidden" name="vDesiredDt" value="<%=vDesiredDt%>">
    <input type="hidden" name="vReqtr" value="<%=vReqtr%>">
    <!--input type="hidden" name="vdate" value="<%=date()%>"-->
    <input type="hidden" name="vContactNo" value="<%=vContactNo%>">
    <input type="hidden" name="vDept" value="<%=vDept%>">
    <input type="hidden" name="vRC" value="<%=vRC%>">
    <input type="hidden" name="vPriority" value="<%=vPriority%>">
    <input type="hidden" name="vfuncReq" value="<%=vfuncReq%>">
    <input type="hidden" name="vFreqVol" value="<%=vFreqVol%>">
    <input type="hidden" name="vSavings" value="<%=vSavings%>">
    <input type="hidden" name="vRevenue" value="<%=vRevenue%>">
    <input type="hidden" name="vBenefit" value="<%=vBenefit%>">
    <input type="hidden" name="vTester" value="<%=vTester%>">
    <input type="hidden" name="vTesterContact" value="<%=vTesterContact%>">
    <input type="hidden" name="vApprovOfficer" value="<%=vApprovOfficer%>">
    <input type="hidden" name="vApprovEmail" value="<%=vApprovEmail%>">
    <input type="submit" name="submit" value="View Form">
    </form>
    <form method="post" action="../mainframe.asp">
    <input type="submit" name="submit" value="Close">
    </form>

    BUT IF I REPLACE IT WITH A FLASH BUTTON... how can the code be working... pls.. help me.. need yr advise

  • #2
    Regular Coder
    Join Date
    Feb 2003
    Location
    South Africa
    Posts
    251
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You will need to use a bit of javascript.

    First of all - you need to name your forms.
    Code:
    <form name="myForm" method="post" action="display_form.asp" target="_blank">
    Then, as the link on the flash button, you must put
    Code:
    javascript:window.document.myForm.submit()
    (No space in javascript - the forum seems to put the space there automatically)
    This will then submit the form as if you have pressed the original submit button.

    Do the same with the other form.
    Bypass your proxy and get anonymous internet surfing FREE!

  • #3
    New Coder
    Join Date
    Mar 2003
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question

    btw the flash button i took is from the dreamweaver...
    then how should i put the link




    javascript:window.document.myForm.submit()

    <object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0" width="105" height="23">
    <param name="BASE" value=".">
    <param name=movie value="view.swf">
    <param name=quality value=high>
    <param name="BGCOLOR" value="#FFFFCC">
    <embed src="view.swf" base="." quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="105" height="23" bgcolor="#FFFFCC">
    </embed>
    </object>

    in where i should put the link... pls help me. i not sure

  • #4
    Regular Coder
    Join Date
    Feb 2003
    Location
    South Africa
    Posts
    251
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You need to re-create the flash button in dreamweaver. When you say "insert flash button", a settings box appears where you need to put the javascript in the link text box. The link wont be in the code, because it is saved by dreamweaver in the flash file.
    Bypass your proxy and get anonymous internet surfing FREE!

  • #5
    New Coder
    Join Date
    Mar 2003
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Not working..

    Sorry..... i put the link the text box.. then run the website..
    i clock on the button nothing pops up or wat........

    <form name="myForm" method="post" action="display_form.asp" target="_blank">

    i done this

    then put the javascript:window.document.myForm.submit()

    on the link all those

    cant seem to work.....

  • #6
    Regular Coder
    Join Date
    Feb 2003
    Location
    South Africa
    Posts
    251
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try both of these:
    Code:
    <form>
    ... Form elements ...
    </form>
    <object classid="clsid: D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0" width="105" height="23">
    <param name="BASE" value=".">
    <param name=movie value="view.swf">
    <param name=quality value=high>
    <param name="BGCOLOR" value="#FFFFCC">
    <embed src="view.swf" base="." quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="105" height="23" bgcolor="#FFFFCC">
    </embed>
    </object>
    or:
    Code:
    <form>
    ... Form elements ...
    <object classid="clsid: D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0" width="105" height="23">
    <param name="BASE" value=".">
    <param name=movie value="view.swf">
    <param name=quality value=high>
    <param name="BGCOLOR" value="#FFFFCC">
    <embed src="view.swf" base="." quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="105" height="23" bgcolor="#FFFFCC">
    </embed>
    </object>
    </form>
    Try both out to see if any work...

    Make sure that in the setttings of you flash button, there is no target set. This is to make sure the javascript runs propperly.

    If nonoe of this works, send me your full code, and i will have a look at it.
    Bypass your proxy and get anonymous internet surfing FREE!

  • #7
    New Coder
    Join Date
    Mar 2003
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cannot work .... sianz... :(

    <!--#include file="../include/dbconn.asp"-->
    <html>
    <script language="JavaScript">
    <!--
    function MM_openBrWindow(theURL,winName,features) { //v2.0
    window.open(theURL,winName,features);
    }
    //-->
    </script>
    <body bgcolor="#FFFFCC">
    <%
    vreqType = Request("vreqType")
    vReqtrEmail = Request("vReqtrEmail")
    'vReqNo = Request("ReqNo")
    vAppnId = Request("vAppnId")
    vreqTitle = replace(trim(Request("vreqTitle")),"'","''")
    'vreqTitle = server.URLencode(trim(Request("vreqTitle")))
    vDesiredDt = Request("vDesiredDt")
    vReqtr = replace(trim(Request("vReqtr")),"'","''")
    'date = Request("date()")
    vContactNo = Request("vContactNo")
    vDept = replace(trim(Request("vDept")),"'","''")
    vRC = Request("vRC")
    vPriority = Request("vPriority")
    vfuncReq = server.URLencode(trim(Request("vfuncReq")))
    vFreqVol = server.URLencode(trim(Request("vFreqVol")))
    vSavings = Request("vSavings")
    vRevenue = Request("vRevenue")
    vBenefit = server.URLencode(trim(Request("vBenefit")))
    vTester = replace(trim(Request("vTester")),"'","''")
    vTesterContact = Request("vTesterContact")
    vApprovOfficer = replace(trim(Request("vApprovOfficer")),"'","''")
    vApprovEmail = Request("vApprovEmail")
    %>
    <% 'validate input

    if vReqtr = "" then
    Response.write ("<br> Error: Please enter Requestor Name. <br><br>")%>
    <input type=button value="Back" onClick="history.go(-1)">
    <% Response.End()
    end if
    if vContactNo = "" then
    Response.write ("<br> Error: Please enter Requestor Contact. <br><br>")%>
    <input type=button value="Back" onClick="history.go(-1)" id=button1 name=button1>
    <% Response.End()
    end if

    if vRC = "" then
    Response.write ("<br> Error: Please enter RC. <br><br>")%>
    <input type=button value="Back" onClick="history.go(-1)" id=button2 name=button2>
    <% Response.End()
    end if
    if vAppnId = "" then
    Response.write ("<br> Error: Please enter Name of Application. <br><br>")%>
    <input type=button value="Back" onClick="history.go(-1)" id=button3 name=button3>
    <% Response.End()
    end if
    if vreqTitle = "" then
    Response.write ("<br> Error: Please enter Request Title. <br><br>")%>
    <input type=button value="Back" onClick="history.go(-1)" id=button4 name=button4>
    <% Response.End()
    end if
    if vfuncReq = "" then
    Response.write ("<br> Error: Please enter Functional Requirement. <br><br>")%>
    <input type=button value="Back" onClick="history.go(-1)" id=button5 name=button5>
    <% Response.End()
    end if
    if vApprovOfficer = "" then
    Response.write ("<br> Error: Please enter Approving Officer Name. <br><br>")%>
    <input type=button value="Back" onClick="history.go(-1)" id=button6 name=button6>
    <% Response.End()
    end if
    if vApprovEmail = "" then
    Response.write ("<br> Error: Please enter Approving Officer Name Email. <br><br>")%>
    <input type=button value="Back" onClick="history.go(-1)" id=button7 name=button7>
    <% Response.End()
    end if
    %>
    <%
    'sql1 = "select ReqMonth from ReqNoRef where ReqMonth = " (Month(Now))
    sql1 = "select ReqYear, LastReqNo from ReqNoRef where ReqMonth = (Month(getDate()))"
    set rs=MSCS.execute(sql1)

    if not rs.eof then
    'Reset Year
    if rs("ReqYear") <> Year(now()) then
    LastNo = 1
    else
    LastNo = rs("LastReqNo") + 1
    end if
    'Format Request Number
    strLastNo = right("000" & cstr(LastNo),4)
    'Format Month
    strMonth = right("0" & cstr(month(date())),2)
    'Format Request No
    ReqNo = "RQ" & cstr(year(date())) & strMonth & strLastNo

    'Format day
    strDay = right("0" & cstr(day(date())),2)
    'Format Request Date
    ReqDt = strDay & "/" & strMonth & "/" & cstr(year(date()))

    'Begin Transactions
    MSCS.Errors.Clear
    MSCS.BeginTrans

    'Insert Request
    sql="INSERT INTO Requests (ReqNo,ReqType,AppnId,reqTitle,ReqDt,DesiredDt,Reqtr,ReqtrEmail,ContactNo,Dept,RC,Priority,funcReq,F reqVol,Savings,Revenue,Benefit,Tester,TesterContact,ApprovOfficer,ApprovEmail)"
    sql=sql & " VALUES "
    sql=sql & "('" & ReqNo & "',"
    sql=sql & "'" & vreqType & "',"
    sql=sql & "'" & vAppnId & "',"
    sql=sql & "'" & vreqTitle & "',"
    sql=sql & "'" & ReqDt & "',"
    sql=sql & "'" & vDesiredDt & "',"
    sql=sql & "'" & vReqtr & "',"
    sql=sql & "'" & vReqtrEmail & "',"
    sql=sql & "'" & vContactNo & "',"
    sql=sql & "'" & vDept & "',"
    sql=sql & "'" & vRC & "',"
    sql=sql & "'" & vPriority & "',"
    sql=sql & "'" & vfuncReq & "',"
    sql=sql & "'" & vFreqVol & "',"
    sql=sql & "'" & vSavings & "',"
    sql=sql & "'" & vRevenue & "',"
    sql=sql & "'" & vBenefit & "',"
    sql=sql & "'" & vTester & "',"
    sql=sql & "'" & vTesterContact & "',"
    sql=sql & "'" & vApprovOfficer & "',"
    sql=sql & "'" & vApprovEmail & "')"
    'Response.Write "Update command" & sql
    'Response.End

    MSCS.execute(sql)

    'Update Last Request No into ReqNoRef
    if rs("ReqYear") <> Year(now()) then
    sql = "update ReqNoRef set ReqYear='" & Year(now())& "', LastReqNo = LastNo where ReqMonth = (Month(getDate()))"
    else
    sql = "update ReqNoRef set LastReqNo='" & LastNo & "' where ReqMonth = (Month(getDate()))"
    end if
    ' Response.Write "Update command" & sql
    ' Response.End
    MSCS.execute(sql)

    if MSCS.Errors.Count = 0 then
    MSCS.CommitTrans
    Response.Write "New IS Request successfully saved <BR>" %>
    <form name="viewForm" method="post" action="display_form.asp"><!-- onsumbit="return validate()"-->
    <input type="hidden" name="vReqNo" value="<%=ReqNo%>">
    <!--input type="hidden" name="vAppnId" value="<%=vAppnId%>">
    <input type="hidden" name="vreqTitle" value="<%=vreqTitle%>">
    <input type="hidden" name="vDesiredDt" value="<%=vDesiredDt%>">
    <input type="hidden" name="vReqtr" value="<%=vReqtr%>"-->
    <!--input type="hidden" name="vdate" value="<%=date()%>"-->
    <!--input type="hidden" name="vContactNo" value="<%=vContactNo%>">
    <input type="hidden" name="vDept" value="<%=vDept%>">
    <input type="hidden" name="vRC" value="<%=vRC%>">
    <input type="hidden" name="vPriority" value="<%=vPriority%>">
    <input type="hidden" name="vfuncReq" value="<%=vfuncReq%>">
    <input type="hidden" name="vFreqVol" value="<%=vFreqVol%>">
    <input type="hidden" name="vSavings" value="<%=vSavings%>">
    <input type="hidden" name="vRevenue" value="<%=vRevenue%>">
    <input type="hidden" name="vBenefit" value="<%=vBenefit%>">
    <input type="hidden" name="vTester" value="<%=vTester%>">
    <input type="hidden" name="vTesterContact" value="<%=vTesterContact%>">
    <input type="hidden" name="vApprovOfficer" value="<%=vApprovOfficer%>">
    <input type="hidden" name="vApprovEmail" value="<%=vApprovEmail%>"-->
    <object classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0" width="100" height="22">
    <param name=movie value="view.swf">
    <param name=quality value=high>
    <param name="BGCOLOR" value="#FFFFCC">
    <embed src="view.swf" base="" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" bgcolor="#FFFFCC">
    </embed>
    </object>

    </form>

    <% else
    MSCS.RollbackTrans
    Response.Write DBConn.Errors.Number
    Response.Write "Warning: saving new IS request failed"
    end if
    end if

    rs.close
    set rs=nothing

    'redirecturl = "request_type.asp"
    'Response.Redirect redirecturl
    %>
    <%
    'Function URLDecode(ByVal What)
    ''URL decode Function
    ''2001 Antonin Foller, PSTRUH Software, http://www.pstruh.cz
    ' Dim Pos, pPos
    '
    ' 'replace + To Space
    ' What = Replace(What, "+", " ")
    '
    ' on error resume Next
    ' Dim Stream: Set Stream = CreateObject("ADODB.Stream")
    ' If err = 0 Then 'URLDecode using ADODB.Stream, If possible
    ' on error goto 0
    ' Stream.Type = 2 'String
    ' Stream.Open
    '
    ' 'replace all %XX To character
    ' Pos = InStr(1, What, "%")
    ' pPos = 1
    ' Do While Pos > 0
    ' Stream.WriteText Mid(What, pPos, Pos - pPos) + _
    ' Chr(CLng("&H" & Mid(What, Pos + 1, 2)))
    ' pPos = Pos + 3
    ' Pos = InStr(pPos, What, "%")
    ' Loop
    ' Stream.WriteText Mid(What, pPos)
    '
    ' 'Read the text stream
    ' Stream.Position = 0
    ' URLDecode = Stream.ReadText
    '
    ' 'Free resources
    ' Stream.Close
    ' Else 'URL decode using string concentation
    ' on error goto 0
    ' 'UfUf, this is a little slow method.
    ' 'Do Not use it For data length over 100k
    ' Pos = InStr(1, What, "%")
    ' Do While Pos>0
    ' What = Left(What, Pos-1) + _
    ' Chr(Clng("&H" & Mid(What, Pos+1, 2))) + _
    ' Mid(What, Pos+3)
    ' Pos = InStr(Pos+1, What, "%")
    ' Loop
    ' URLDecode = What
    ' End If
    'End Function
    %>

    <% 'send email to approval officer

    'sql1 = "select ReqTitle from Requests where ReqNo = ReqNo"
    'set rs2=MSCS.execute(sql1)

    sql = "select * from ReqTypeRef where ReqType='" & vreqType& "'"
    set rs1 = MSCS.Execute(sql)
    ReqDesc = rs1("ReqDes")
    rs1.close
    set rs1=nothing

    Set Mailobj = Server.CreateObject("CDONTS.NewMail")

    Mailobj.From = "ConBiz IS Request (" & vReqtrEmail & ")"
    Mailobj.To = vApprovEmail
    Mailobj.Bcc = "wenxiang@singtel.com"
    Mailobj.Subject = "New IS Request for Approval"
    Mailobj.Body = "Hi " & vApprovOfficer & "!" & vbCrLf & vbCrLf & _
    "Request Type: " & ReqDesc & "" & vbCrLf & _
    "Application Name: " & vAppnId & "" & vbCrLf & _
    "Request No: " & ReqNo & "" & vbCrLf & _
    "Request Title: " & vreqTitle & "" & vbCrLf & _
    "Requestor: " & vReqtr & "" & vbCrLf & vbCrLf & vbCrLf &_
    "Please click on the embedded hyperlink below to endorse the request." & vbCrLf & _
    "http://sg_05_webdev:87/default.asp" & vbCrLf

    Mailobj.Send
    Set Mailobj = Nothing

    'rs2.close
    'set rs2=nothing

    %>
    </body>
    </html>
    <!--#include file="../include/dbclose.asp"-->

  • #8
    Regular Coder
    Join Date
    Feb 2003
    Location
    South Africa
    Posts
    251
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I took the following code from the code you gave me and tested it by its self...
    The flash button must have the link "javascript:window.document.viewForm.submit()" to work with the form.
    PHP Code:
    <form name="viewForm" method="post" action="display_form.asp">
    <
    input type="hidden" name="vReqNo" value="<%=ReqNo%>">
    <
    object classid="clsid: D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="100" height="22">
        <
    param name="movie" value="view.swf">
        <
    param name="quality" value="high">
        <
    embed src="view.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" ></embed
      </
    object>
    </
    form
    It works fine like this for me, so it should be fine on your side
    Bypass your proxy and get anonymous internet surfing FREE!

  • #9
    New Coder
    Join Date
    Mar 2003
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Thanks man

    Brother i got it working.. finally.. thanks a lot..

  • #10
    Regular Coder
    Join Date
    Feb 2003
    Location
    South Africa
    Posts
    251
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No problem - Glad I could help
    Bypass your proxy and get anonymous internet surfing FREE!

  • #11
    New Coder
    Join Date
    Mar 2003
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Queries

    <input type="submit" name="insert" value="Submit" onClick="return VerifyData(form1)">&nbsp;&nbsp;
    <input type="reset" name="reset" value="Reset">&nbsp;&nbsp;
    <input type="button" name="cancel" value="Cancel" onclick="javascript:window.history.back(-1)">



    i want to change them to flash buttons... then how will it work then

    i changed my first button submit to flash button... then my VerifyData seems.. to be working differently.... use to be pop up message nows its goes to the nxt page.....

    need yr help in this?

  • #12
    Regular Coder
    Join Date
    Feb 2003
    Location
    South Africa
    Posts
    251
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok, well - here it goes...
    <input type="reset" name="reset" value="Reset">
    Make the flash button with the link "window.document.viewForm.reset()" where viewForm is the name of your form.

    <input type="button" name="cancel" value="Cancel" onclick="javascript:window.history.back(-1)">
    Make the flash button with the link "javascript:window.history.back(-1)"

    <input type="submit" name="insert" value="Submit" onClick="return VerifyData(form1)">
    This is a bit of a tough one...

    You will have to make a new javascript function. ie:
    Code:
    function viewIt(){
      if(VerifyData(form1)){
        window.document.form1.submit();
      }else{
        alert("Not all fields are vald!");
      }
    }
    And make the flash button with the link "javascript:viewIt()"

    Take out the "onSubmit" part from the form - this wont be used any more.
    Bypass your proxy and get anonymous internet surfing FREE!

  • #13
    New Coder
    Join Date
    Mar 2003
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile queries??

    <input type=button value="Back" onClick="history.go(-1)" id=button7 name=button7>

    <input type="submit" name="submit" value="Close">


    how to do for close and back buttons......
    can teach me...

  • #14
    New Coder
    Join Date
    Mar 2003
    Posts
    58
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile tanks man

    bro i got the back and close buttons.. working... i knew wat to do already..

    but now my reset is not working... cant reset the form......

    i put link it isnt working... need r help

  • #15
    Regular Coder
    Join Date
    Feb 2003
    Location
    South Africa
    Posts
    251
    Thanks
    0
    Thanked 0 Times in 0 Posts
    javascript:window.document.viewForm.reset() should work fine - Just remember to have the "javascript:" (no spaces) in front of it, and to change viewForm(in bold above) to whatever you named your form...
    Bypass your proxy and get anonymous internet surfing FREE!


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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