## API

Search:

Method | Function
--- | ---
aspL.aspError | Flushes VBScript runtime error (if any) and stops executing the page
aspL.CheckEmailSyntax(value) | Checks syntax of email address - returns true/false
aspL.clearAllCache | Clears all cache from the Application
aspL.clearCache (name) | Clears Application cache for item "name"
aspL.clone(str, n) | Clones str for n times
aspL.convertBool(value) | Returns VBScript true or false (never null)
aspL.convertNmbr(value) | Returns VBScript double or 0 (never null)
aspL.convertStr(value) | Returns VBScript string (never null)
aspL.dict | Returns a Scripting.Dictionary Object
aspL.die | Destroys all plugins and terminates the page
aspL.dump(value) | Flushes value to the browser and terminates the page
aspL.dumpBinary(path,filename) | Flushes binary file to the browser and terminates the page. Filename (optional) is the full name of the file offered for download (default: the original filename)
aspL.exec(filepath) | Executes the ASP/VBScript code from filepath
aspL.form | Returns an aspLite formbuilder object
aspL.fso | Returns a Scripting.FilesystemObject
aspL.getCache(name) | Returns the Application cache for item "name"
aspL.getCacheT (name, seconds) | Returns the Application cache for item "name" if it has been cached less than x seconds ago
aspL.getFileType(filepath) | Returns the file-extension for the filepath
aspL.getRequest(name) | Returns item from the request-collections querystring or form If a name appears both in the form and the querystring, the form-value will be returned
aspL.htmlEncJs(value) | HTML encodes a JavaScript snippet
aspL.IsAlphaNumeric(value) | Checks if value is alphanumeric - returns true/false
aspL.isEmpty(value) | Checks if value is empty or null - returns true/false
aspL.isNumber(value) | Checks if value is a number - returns true/false
aspL.json | Returns a Json object - based ASP JSON Generator in asp-ajaxed.org
aspL.length(value) | Replaces VBS len() (survives null)
aspL.loadText(filepath) | Loads text from filepath
aspL.log(value) | Can be used to log events to asplite/asplite.log
aspL.padLeft (value, length, char) | Adds x-nmbr of chars to value as long as value.length<=length
aspL.pathInfo | Loads pathinfo in case custom 404 is configured
aspL.pCase(value) | First character of value will convert to uppercase, others to lowercase
aspL.plugin(name) | Returns a plugin object with that name (it's already created)
aspL.printTimer | Returns the page execution time so far
aspL.randomizer | Returns an aspLite randomizer object
aspL.sanitize(value) | Basic htmlencode
aspL.sanitizeJS(value) | Basic JavaScript single quote-escape
aspL.setCache(name,value) | Sets Application item with a given value
aspL.stripHTML(value) | Strips HTML-tags from value (keeping only text)
aspL.sqli(value) | Basic sql-injection prevention (single quotes -> two quotes)
aspL.xmldom(url) | Returns fetched xml from url via "MSXML2.DOMDocument"
aspL.xmlhttp(url,binary) | Returns fetched text or binary from url via "MSXML2.ServerXMLHTTP"

Showing entries (filtered from total entries)

## Formbuilder

### aspLite.form returns a form-object. Form objects can behave as full-featured forms, but they can also be limited to a single html element, or even no element at all.

Search:

Property | Description
--- | ---
doScroll | true/false - default false - sets whether or not to scroll to the top of the form when the form is loaded
id | read/write - sets or gets the formID. aspLite automatically assigns a form.id based on the asplTarget-parameter (cannot be empty!)
initialize | true/false - default true - sets whether or not to initialize the form-fields with values from the request collections
offSet | number of pixels to stay away from the top of the page in case doScroll=true
onSubmit | read/write - sets or gets the onsubmit JavaScript - by default aspLite submits the form with its built-in Ajax function
offSet | read/write - number of pixels to stay away from the top of the page in case doScroll=true
postback | read/write - true/false - returns true when a form is submitted by the browser
reload | read/write - number - automatically submits the form every x seconds
sameSession | read/write - true/false - returns true when a form is submitted by the browser AND the same sessionID was returned
target | read/write - sets or gets the target HTML elementID to bind to the form to (cannot be empty!)
Method |
field(type) | creates a new field of a given type - regular VBScript dictionary
build | creates the form and returns a Json string to the browser

Showing entries (filtered from total entries)

Supported field-types for aspLite forms:

dim form : set form = aspl.form
dim field : set field = form.field(XXX)

A "field" is actually a regular VBScript dictionary. What are the supported field-types?

First things first: do not feel limited by the set of types below.
You can add plain html (that can also include inline JavaScript and CSS).
The only element that you should NOT add, is a <form> element. That is already added by aspLite.

set field = form.field ("plain")
field.add("html") = "<p>any html, or even CSS/JavaScript</p>"

hidden field

set field = form.field ("hidden")
field.add ("value")=""
field.add ("id")=""
field.add ("name")=""

css-link-tag

set field = form.field ("link")
field.add ("rel")=""
field.add ("href")=""

regular button

set field = form.field ("button")
field.add ("id")=""
field.add ("class")=""
field.add ("style")=""
field.add ("onclick")=""

reset button

set field = form.field ("reset")
field.add ("class")=""
field.add ("style")=""

inline style

set field = form.field ("style")
field.add ("text")=""

any known HTML element

set field = form.field ("element")
field.add ("tag")=""
field.add ("html")=""
field.add ("id")=""
field.add ("class")=""
field.add ("style")=""
field.add ("onclick")=""

JavaScript block

set field = form.field ("script")
field.add ("text")=""

JavaScript file

set field = form.field ("script")
field.add ("src")=""

textarea

set field = form.field ("textarea")
field.add ("cols")=""
field.add ("rows")=""
field.add ("id")=""
field.add ("name")=""
field.add ("style")=""
field.add ("required")=""
field.add ("class")=""
field.add ("value")=""

select boxes

set field = form.field ("select")
field.add ("id")=""
field.add ("name")=""
field.add ("style")=""
field.add ("required")=""
field.add ("class")=""
field.add ("value")=""
field.add ("onchange")=""
field.add ("multiple")=""
field.add ("size")=""
field.add ("emptyfirst")=""
field.add ("options")=VBScript dictionary!

radio buttons

set field = form.field ("radio")
field.add ("id")=""
field.add ("name")=""
field.add ("style")=""
field.add ("required")=""
field.add ("class")=""
field.add ("value")=""
field.add ("options")=VBScript dictionary!

checkboxes

set field = form.field ("checkbox")
field.add ("id")=""
field.add ("name")=""
field.add ("style")=""
field.add ("required")=""
field.add ("class")=""
field.add ("value")=""
field.add ("options")=VBScript dictionary!

finally, any other <input> field (text, date, email, file, etc)
set field = form.field ("checkbox")
field.add ("type")="text" / "date" / "email" / "number" / etc
field.add ("value")=""
field.add ("name")=""
field.add ("class")=""
field.add ("placeholder")=""
field.add ("onclick")=""
field.add ("maxlength")=""
field.add ("id")=""
field.add ("style")=""
field.add ("required")=""
field.add ("onchange")=""

## Randomizer

### The aspLite randomizer returns random ASCII (a-z) texts and random numbers (between a range)

Search:

Method | Function
--- | ---
randomizer.randomText(nmbrChars) | returns a random text of a given length (nmbrChars)
randomizer.randomNumber(startnr,stopnr) | returns a random number between startnr and stopnr (included)

Showing entries (filtered from total entries)
Download on GitHub Demo

© Copyright 2024 - Contact me on GitHub - website gratefully hosted by Github Pages