[include ajaxfunctions.inc] [!]************************************************************************ this page - has form input & div with unique ID javascript dbsearch/display page ajax functions take 3 variables: [funcID] unique name for the javascript function [HotSpot] unique name for the div where the results show up [dnafile] name of WebDNA file which processes WebDNA form will send a variable to be parsed as you wish on your WebDNA page Copyright 2012 Terry Wilson terry@terryfic.com ************************************************************************[/!]
WebDNA AJAX FunctionsAJAX provides a way to communicate with the server and return a result without refreshing the page. Most of these functions take three variables: a unique javascript function name, a unique element ID name, and the name of the WebDNA file which is retrieved (the form input value will be sent in the query string). These examples use WebDNA tables in the external WebDNA file to simplify the example.
|
ajaxBasicQueryBasic Query sends a variable to the specified WebDNA page where you perform all kinds of magic, and AJAX returns the parsed page in the DIV section below. This could be a single record or a list of many records.[text multi=t]funcID=findname&HotSpot=nameresult&dnafile=content.dna[/text] [ajaxBasicQuery] |
ajaxDBEntryDB Entry sends a form to the specified WebDNA page where data is written to your database. AJAX returns the parsed page in the DIV section below, confirming your added record, and showing the five before that. No need to reload the page; just keep adding records.[text multi=t]funcID=add2database&HotSpot=sampleresult&dnafile=sample.dna[/text] [ajaxDBEntry] |
ajaxSuggestAuto Suggest sends a variable to the specified WebDNA page where you search for records, possibly returning several that match. The list of returns displays as a drop down list, and the user clicks one to autocomplete the text field. (In this example, "a" and "b" will return results.)[text multi=t]funcID=suggestname&HotSpot=suggestresult&dnafile=suggest.dna[/text] [ajaxSuggest] |