NB WebForms Functions
Moderator: Neosoft Support
NB WebForms Functions
As part of a larger project, I have created a function that allows the dynamic creation of forms for data input and retrieval using a web browser object and HTML forms.
The WebFormsCreate function will create a form based on field definition syntax that follows this pattern:
Field Label\:datatype Attributes Data1\,Data2\,Data3\;
with additional fields separated by the delimiter \;
The types of entry form include: text, dropdown, listbox listboxmulti (multiple selections), radio, checkbox, textarea, date, time, file, password, hidden, button, code (to insert code for scripts/CSS/HTML, etc within the form).
The forms that are created are (currently) less than stunning in appearance and are structured using tables but there are divs in the HTML that should allow for some basic CSS formating. Also, the templates that create the HTML can be modified to use a table less structure in the future.
The WebFormsGetVal function is an NB based forms processor that will (currently) only process HTML forms made with the WebFormsCreate function. This processor retrieves the data of the submitted form and places the values in two variable arrays, one with the format fieldname=value; the other with the form fieldlabel=value.
All required files (demo pub, functions, and some additional JS & CSS files plus small graphics can be downloaded here.
Unzip the file in a folder by itself, place the functions in your NB\Functions folder (where NB is installed) and open the demo.pub file to examine it and run the demo.
Comments are welcome. Suggestions for improvements are encouraged. Help with improving the form appearance with CSS would be great
The WebFormsCreate function will create a form based on field definition syntax that follows this pattern:
Field Label\:datatype Attributes Data1\,Data2\,Data3\;
with additional fields separated by the delimiter \;
The types of entry form include: text, dropdown, listbox listboxmulti (multiple selections), radio, checkbox, textarea, date, time, file, password, hidden, button, code (to insert code for scripts/CSS/HTML, etc within the form).
The forms that are created are (currently) less than stunning in appearance and are structured using tables but there are divs in the HTML that should allow for some basic CSS formating. Also, the templates that create the HTML can be modified to use a table less structure in the future.
The WebFormsGetVal function is an NB based forms processor that will (currently) only process HTML forms made with the WebFormsCreate function. This processor retrieves the data of the submitted form and places the values in two variable arrays, one with the format fieldname=value; the other with the form fieldlabel=value.
All required files (demo pub, functions, and some additional JS & CSS files plus small graphics can be downloaded here.
Unzip the file in a folder by itself, place the functions in your NB\Functions folder (where NB is installed) and open the demo.pub file to examine it and run the demo.
Comments are welcome. Suggestions for improvements are encouraged. Help with improving the form appearance with CSS would be great
David Payer
Des Moines, Iowa
USA
Des Moines, Iowa
USA
Re: NB WebForms Functions
Looks cool. Thanks, David!
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour
Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour
Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
-
- NeoSoft Team
- Posts: 5628
- Joined: Thu Mar 31, 2005 10:48 pm
- Location: Oregon, USA
- Contact:
Re: NB WebForms Functions
Been playing about with this - it's beyond cool. What a fantastic concept that opens up a lot of extra potential! Now I going to get my thinking cap on and come up with uses
What I do and How I do it. - http://andybrocklehurst.com
Re: NB WebForms Functions
Hello
Check my code in the subroutines. discovered a
But the space after the comma may be more than one?
I think it would be this:
Check my code in the subroutines. discovered a
Code: Select all
StrReplace "[ThisFieldOPTIONS]" ", " "," "[ThisFieldOptions]" ""
I think it would be this:
Code: Select all
SearchStr ",[#32]" "[ThisFieldOPTIONS]" "[Result]" ""
While "[Result]" "<>" "0"
StrDel "[ThisFieldOPTIONS]" "[Result]+1" "1" "[ThisFieldOPTIONS]"
SearchStr ",[#32]" "[ThisFieldOPTIONS]" "[Result]" ""
EndWhile
Re: NB WebForms Functions
Code: Select all
StrReplace "[ThisFieldOPTIONS]" ", " "," "[ThisFieldOptions]" ""
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour
Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour
Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
Re: NB WebForms Functions
Translation is perhaps not quite accurately conveys what I mean.
Code which is in the subroutine:
Removes extra spaces if they are accidentally added. But the gap may be added not one, but 2.3 - ...
For example, the list looks like:
item 1
item 2
item 3
If you accidentally add a space, then the form of the list is changed and may look something like this
item 1
item 2
item 3
What would this did not happen as I understand it, and there is code in the subroutine:
But it removes only one space. I proposed a version that will remove all the extra spaces.
Code which is in the subroutine:
Code: Select all
StrReplace "[ThisFieldOPTIONS]" ", " "," "[ThisFieldOptions]" ""
For example, the list looks like:
item 1
item 2
item 3
If you accidentally add a space, then the form of the list is changed and may look something like this
item 1
item 2
item 3
What would this did not happen as I understand it, and there is code in the subroutine:
Code: Select all
StrReplace "[ThisFieldOPTIONS]" ", " "," "[ThisFieldOptions]" ""
Re: NB WebForms Functions
This may be good.mishem wrote:Hello
Check my code in the subroutines. discovered aBut the space after the comma may be more than one?Code: Select all
StrReplace "[ThisFieldOPTIONS]" ", " "," "[ThisFieldOptions]" ""
I think it would be this:Code: Select all
SearchStr ",[#32]" "[ThisFieldOPTIONS]" "[Result]" "" While "[Result]" "<>" "0" StrDel "[ThisFieldOPTIONS]" "[Result]+1" "1" "[ThisFieldOPTIONS]" SearchStr ",[#32]" "[ThisFieldOPTIONS]" "[Result]" "" EndWhile
If your input is well defined you will not have this kind of problem with too many spaces. I was attempting to do a clean up of the data but your method does the job well.
David
David Payer
Des Moines, Iowa
USA
Des Moines, Iowa
USA
Re: NB WebForms Functions
that's a good idea I will have to study the code --- you know your stuff !!!!!!