Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    202

    Unanswered: Using InputBox Syntax

    Hi there,

    Can anyone help me with this issue.
    I need to pop up a input box in asp and need the user to key in their
    emp no.
    some how i use the input box command, my system keep coming up with error like this

    Error Type:
    Microsoft VBScript runtime (0x800A0046)
    Permission denied: 'InputBox'

    my code is like this

    <%
    dim fname
    fname=InputBox("Enter your name:")
    MsgBox("Your name is " & fname)
    %>

    but when i put in

    <script language="VBScript">
    dim fname
    fname=InputBox("Enter your name:")
    MsgBox("Your name is " & fname)
    </script>

    then it can work.
    Can anyone tell me how can i make the first coding to work by using
    <% %> tag instead of <script language="vbscript"> tag
    thanx

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    dude, one is a client side script one is a server side script....

    what exactly are you trying to achieve....

    I suspect you want a page to come up, pop up a box asking for a name, then use that name for the rest of the processing of the page....

    If this is the case your best bet is to do a javascipt pop up initially, use the value entered to submit back to the base page and then process using that info.... so something like... (in psuedo code)

    Code:
    <%
    if request.querystring("name")="" then
    %>
      <script language="VBScript">
      dim fname
      fname=InputBox("Enter your name:")
      MsgBox("Your name is " & fname)
      document.location.href=document.location.href & "?name=" & fname
      </script>
    <%
      response.end
    else
      myName = request.querystring("name")
      do whatever processing
      print out some html
    end if
    %>
    I think that theory should work

Posting Permissions

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