Hi fellas iam a nbpro newbie and right now iam stuck i just can make SQL statement in General Tab queries for some thing like this
SELECT * from mytable WHERE my field = #jsvar#
its for a Menu of buttons and every button browses different queries
alternate ways to make same task welcome any ideas and advises
Thank you and what a state of art software you developed nbpro team really amazing.
Welcome to the nuBuilder Forums!
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Button passes js var to SQL query to browse filtered data
-
- Posts: 11
- Joined: Fri Aug 16, 2013 4:14 pm
Re: Button passes js var to SQL query to browse filtered dat
Ralcala,
I'm not sure what you are asking but unless your field is a number you will need to put quotes around the hash variable in your sql eg.
Steven
I'm not sure what you are asking but unless your field is a number you will need to put quotes around the hash variable in your sql eg.
Code: Select all
SELECT * from mytable WHERE my field = '#jsvar#'
-
- Posts: 11
- Joined: Fri Aug 16, 2013 4:14 pm
Re: Button passes js var to SQL query to browse filtered dat
Thanks Steven for your quick replay
Here is the process
1.- A Menu of 10 buttons every button have a event on click a JavaScript var to store two digit
2.- When the form loads previously modified SQL Statment on General Tab to
SELECT * mytable WHERE myfield = a global var stored with a two digit previously on click event
3.- Browse window shows only data selected.
my question is what is the code for js in the event on click to store two digit on a global variable that where accessible by all nbpro environment.
Thanks again Steven
Here is the process
1.- A Menu of 10 buttons every button have a event on click a JavaScript var to store two digit
2.- When the form loads previously modified SQL Statment on General Tab to
SELECT * mytable WHERE myfield = a global var stored with a two digit previously on click event
3.- Browse window shows only data selected.
my question is what is the code for js in the event on click to store two digit on a global variable that where accessible by all nbpro environment.
Thanks again Steven
Re: Button passes js var to SQL query to browse filtered dat
Ralcala,
Use hash variables.
If you have a field on your Form called two_digits, your Browse Form can use this in its SQL eg.
http://wiki.nubuilder.net/index.php/Hash_Variables
Steven
Use hash variables.
If you have a field on your Form called two_digits, your Browse Form can use this in its SQL eg.
Code: Select all
SELECT * FROM inventory WHERE inv_code = '#two_digits#'
Steven