devshb
Senior Member
United Kingdom
1904 Posts |
Posted - July 24 2007 : 15:04:25
|
it's a standard vbscript function (ie not a vpasp function) it's used to find out what an argument or field value is, or what button has just been pressed when submitting the form.
you can also use:
request.form("myfieldname") (to specifically find out what a field's value was upon form submission/posting)
or request.querystring("myargument") (to specifically find out what an argument was in the url)
the general request("myname") function will fall-through, checking that name's value for arguments and fields.
for form submissions, when checking if a certain buttons was pressed, it is uses "name" and "name.x" on the checks, because when using image buttons for some weird reason the request object also needs a ".x" on the end of the name being requested. so, the bit with the "continue" checks in it is checking to see which button has just been pressed and to see if the form has just been submitted or if it's just been opened for the first time.
if your form only has one submit button on it, or if you only want to find out whether the form has been submitted or loaded for the first time, then you can use a server variable instead, ie:
if (Request.ServerVariables("REQUEST_METHOD")="POST") then the form has just been submitted, now process it, using request("myfieldname") or request.form("myfieldname") etc to find what the values were else the screen has been opened but not submitted so just setup the default variables etc, or use request("myargumentname") or request.querystring("myargumentname") etc to find out what the querystrings were to the url (if any) end if now show the form
if you're delving into the asp side of things, then here's a fantastic link, a kind of online manual which explains with examples all the standard functions, definitely not a thing that's only for newbies; I use it all the time too, it's a really great reference manual and explains all the potential weirdnesses and syntax of the various functions:
VBScript Language Reference Manual: http://msdn2.microsoft.com/en-us/library/d1wf56tt.aspx
(don't bother using the search function on that manual though because it'll just search the whole microsoft reference library; instead just drill-down on the functions/statements links etc on the left-panel; but watch out; that url only works properly on internet explorer, if you try it on netscape etc you end up with nested windows or errors each time you click on something)
annoyingly, for some strange reason, microsoft have put the request help outside that manual and put it into their iis manual instead: http://msdn2.microsoft.com/en-us/library/ms524948.aspx
Simon Barnaby Developer [email protected] www.BigYellowZone.com Web Design, Online Marketing and VPASP addons |
Edited by - devshb on July 24 2007 15:35:55 |
|
|