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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up Javasript Disappearing button?!!?

    hi

    i want the function "leapto " (Which is a yes & no buttons) to disappear according to this condition (Highlighted by red in the code)



    Code:
    html>
    <head>
    <script>
    function leapTo (link)
       {
       var new_url=link;
       if (  (new_url != "")  &&  (new_url != null)  )
          window.location=new_url;
       }
    </SCRIPT>
    </head>
    <body background="back.png">
    <br><br><br>
    
    <%
    set db=server.createobject("ADODB.connection")
    db.open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ="+server.mapPath ("db1.mdb"))
    set record=server.createobject("adodb.recordset")
    
    if request.form("addaccountid")<>"" then
    record.open "select * from personal where accountid like '" & request.form("addaccountid") & "'",db,1,3
    end if
    
    Session("aid")=(request.form("addaccountid"))
    
    if record.EOF then
    Response.write("Invaild Account Id")
    else
    response.write("<p align=center>"&"<font size=6 face=Verdana>"&"Account Info."&"</font>"&"</p>")
    
    
    response.write("<table width=400 border=1 align=center>")
    
    
    	response.write("<tr>")
            response.write("<th>")
            response.write("Account ID")
            response.write("</th>")
    	response.write("<td>" & record("accountid") & "</td>")
            response.write("</tr>")
    .
    .
    .
    .
    response.write("</table>")
    end if
    %>
    	
    <CENTER>
    <FORM name=frm method=post>
    <TABLE BORDER=3 WIDTH=500>
    <TD align="center" BGCOLOR=000080>
    
      <INPUT TYPE="radio" NAME="Yes" onClick="leapTo('AmountOfCredit.asp')">
      <FONT COLOR=00FFFF><B>YES</B></FONT>
    <TD align="center"  BGCOLOR=FF0000>
      <INPUT TYPE="radio" NAME="No" onClick="leapTo('AddCredit.asp')">
      <FONT COLOR=000000><B>NO</B></FONT>
    </TABLE>
    </FORM>
    </CENTER>
    </body>
    
    </html>
    So anybody has any idea a bout this move?!?!

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    try adding a variable that gets set during you if/else statement

    then when it is showing the radio buttons have an if statement and check for that variable, if true then show the radio buttons by writing out the code.

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]


  •  

    Posting Permissions

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