I am using chronoforms v6 and noticed that in many cases there is no need to create extra code for some functions. I am counting the number of records in a database and hovering LOOP to generate a list for a DROPDOWN ... Example: I find that I have 4 records in a database, how to dynamically feed a DROPDOWN with the "1,2,3,4" choice options? Is there a way to implement without generating extra code?
There's a dynamic dropdown example in the demo forms.
Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine! Donations: paypal.me/healyhatman Professional Work: kamron@skyspider.com.au Custom CF / CC Plugins and Extensions: skyspider.com.au/store
I am using a PHP to populate the dropdown with a count of database records, one same works well plus I have to get the maximum value of records that comes from the amount of records in the database. The value is in read_data15 it indicates that it is number 3, however when using in "for" this value is ZERO ...
Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine! Donations: paypal.me/healyhatman Professional Work: kamron@skyspider.com.au Custom CF / CC Plugins and Extensions: skyspider.com.au/store
m are you sure it's 3, or is it an array containing the number 3
Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine! Donations: paypal.me/healyhatman Professional Work: kamron@skyspider.com.au Custom CF / CC Plugins and Extensions: skyspider.com.au/store
I am counting records through the option below in read_data15 and currently have 3 records ... I need this value inside the "for" to be able to create 3 elements in the array that goes to the dropdown when returning from PHP
the read_data15...
Select type = Return the count of records matching the filtering conditions.
Oh sorry I see the problem. You can't use shortcode a in PHP.
{var:} should be $this->get("variable name", "default if not found");
Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine! Donations: paypal.me/healyhatman Professional Work: kamron@skyspider.com.au Custom CF / CC Plugins and Extensions: skyspider.com.au/store
Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine! Donations: paypal.me/healyhatman Professional Work: kamron@skyspider.com.au Custom CF / CC Plugins and Extensions: skyspider.com.au/store
You didn't read what I wrote properly, $this->get takes two parameters - the name of the variable you want to retrieve, and a default value if the variable is not found.
Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine! Donations: paypal.me/healyhatman Professional Work: kamron@skyspider.com.au Custom CF / CC Plugins and Extensions: skyspider.com.au/store
Web developer at SkySpider.com.au - I DO NOT work for ChronoEngine! Donations: paypal.me/healyhatman Professional Work: kamron@skyspider.com.au Custom CF / CC Plugins and Extensions: skyspider.com.au/store
Thanks a lot for the guidance, you are correct ... however the implementation described in the video is working correctly ... at the time I noticed that $ this in the chronoforms is an access to the entire structure of the project simply by knowing how to access the desired variables, thank you...
Throughout my code I will certainly have other doubts, thank you very much.
I am counting the number of records in a database and hovering LOOP to generate a list for a DROPDOWN ...
Example: I find that I have 4 records in a database, how to dynamically feed a DROPDOWN with the "1,2,3,4" choice options?
Is there a way to implement without generating extra code?
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
$results = array();
$quant = '{var:read_data15}';
$results
for ($i = 1; $i <= $quant; $i++) {
$results
}
return $results;
$results = array();
$quant = '{var:read_data15}';
$results
for ($i = 1; $i <= $quant; $i++) {
$results
}
return $results;
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
$quant = '{var:read_data15.model}';
$results[ ] = 'Selecione o ponto desejado';
for ($i = 1; $i <= $quant; $i++) {
$results[ ] = 'Ponto '.$i;
}
return $results;
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
Donations: paypal.me/healyhatman
Professional Work: kamron@skyspider.com.au
Custom CF / CC Plugins and Extensions: skyspider.com.au/store
Throughout my code I will certainly have other doubts, thank you very much.