If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Using InputBox Syntax

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-26-04, 23:31
michaelfg81 michaelfg81 is offline
Registered User
 
Join Date: Mar 2004
Posts: 202
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
Reply With Quote
  #2 (permalink)  
Old 10-27-04, 02:05
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On