Request variables and useing alert

Results 1 to 2 of 2

Thread: Request variables and useing alert

  1. #1
    Join Date
    Dec 1969

    Default Request variables and useing alert

    Hello,<BR><BR>Can anyone answer these questions?<BR><BR>If you do the following ..<BR><BR>mstock=request.form("mstock")<BR><BR>Can you later in the form do this ...<BR><BR>anotherstock=request.form("mstock")<BR> <BR>Can you keep requesting a value from aprevious form and assign it to different variables?<BR><BR>Also, I&#039m haveing trouble getting the alert keyword to work. I either get it to work but not correctly or not work at all. My code is below...<BR><BR><BR><BR>&#060;script LANGUAGE="VBScript"&#062;<BR><BR> <BR>Dim dstock<BR>mstock=request.form("mstock")<BR>itemid= request.form("itemid")<BR>stocks=request.form("Sto ckBox")<BR>cstock=request.form("cstock")<BR>cstock =cstock-stocks<BR>If cstock = mstock then<BR> Alert("Stock for item has reached Min Stock Level")<BR>End If<BR>If cstock &#060; mstock then<BR> Alert("Stock has fallen below Min Stock Level")<BR>End If<BR>If cstock &#060; 0 then<BR> Alert("No more in Stock")<BR>End If<BR>&#060;/script&#062;

  2. #2
    Join Date
    Dec 1969

    Default RE: Request variables and useing alert

    Are you trying to do this on the client or the server? Request.Form is only available on the server (as it represents the part of the HTTP request the server is processing), but you can&#039t do an alert on the server because it&#039s in a locked room hundreds of miles from you users - there isn&#039t going to be anyone to click &#039OK&#039!<BR><BR>You can assign a value from the form collection to as many variables as you like, but it&#039s still the same value and doing it like that involves multiple COM calls - very inefficient. Grab the value once from the form collection and then use your local variable - that&#039s much quicker.<BR><BR>HTH<BR><BR>Dunc

Posting Permissions

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