Source language: Translate to:

NB WebForms Functions

Questions and information about using VBScript and JavaScript in NeoBook functions

Moderator: Neosoft Support

NB WebForms Functions

Postby dpayer » Wed Feb 20, 2013 3:23 pm

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.
Image
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.
Image

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.
Image

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
User avatar
dpayer
 
Posts: 1384
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: NB WebForms Functions

Postby Wrangler » Thu Feb 21, 2013 8:46 am

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
User avatar
Wrangler
 
Posts: 1507
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA

Re: NB WebForms Functions

Postby Neosoft Support » Thu Feb 21, 2013 1:30 pm

Very cool!
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5605
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: NB WebForms Functions

Postby andybrock » Thu Apr 04, 2013 9:18 am

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
User avatar
andybrock
 
Posts: 181
Joined: Mon Apr 20, 2009 1:38 pm
Location: Somerset, UK

Re: NB WebForms Functions

Postby mishem » Sat Apr 06, 2013 7:43 am

Hello
Check my code in the subroutines. discovered a
Code: Select all
StrReplace "[ThisFieldOPTIONS]" ", " "," "[ThisFieldOptions]" ""

But the space after the comma may be more than one?
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
mishem
 
Posts: 576
Joined: Mon Oct 08, 2012 1:51 pm

Re: NB WebForms Functions

Postby Wrangler » Sat Apr 06, 2013 8:14 am

Code: Select all
StrReplace "[ThisFieldOPTIONS]" ", " "," "[ThisFieldOptions]" ""


You can have as many spaces as you want. Or tabs etc. You can also use the ascii symbols, but not necessary.
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
User avatar
Wrangler
 
Posts: 1507
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA

Re: NB WebForms Functions

Postby mishem » Sat Apr 06, 2013 8:27 am

Translation is perhaps not quite accurately conveys what I mean.

Code which is in the subroutine:
Code: Select all
StrReplace "[ThisFieldOPTIONS]" ", " "," "[ThisFieldOptions]" ""


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:
Code: Select all
StrReplace "[ThisFieldOPTIONS]" ", " "," "[ThisFieldOptions]" ""


But it removes only one space. I proposed a version that will remove all the extra spaces.
mishem
 
Posts: 576
Joined: Mon Oct 08, 2012 1:51 pm

Re: NB WebForms Functions

Postby dpayer » Sat Apr 06, 2013 9:23 am

mishem wrote:Hello
Check my code in the subroutines. discovered a
Code: Select all
StrReplace "[ThisFieldOPTIONS]" ", " "," "[ThisFieldOptions]" ""

But the space after the comma may be more than one?
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


This may be good.

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
User avatar
dpayer
 
Posts: 1384
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: NB WebForms Functions

Postby robertpet » Sun Aug 27, 2017 3:47 am

that's a good idea I will have to study the code --- you know your stuff !!!!!! 8)
robertpet
 
Posts: 10
Joined: Fri Aug 04, 2017 5:56 am


Return to NeoBook Functions - VBScript & JavaScript

Who is online

Users browsing this forum: No registered users and 3 guests