Hi there,
I was wondering why my application isn’t working properly:
I have a table called ‘artikelen’, as shown below:
[I]ARTIKELEN
ArtikelID | Artikelnaam (TEXT) | Artikelverkoopprijs (CURRENCY)
1 product1 €10
2 product2 €25
3 product3 €100[/I]
In the database the field ‘artikelnaam’ is of the type ‘varchar(255)’ and the field ‘artikelverkoopprijs’ is of the type ‘INT(255)’.
I’ve created a form_editable_grid where the fields ‘artikelnaam’ (label: orderdetailsartikelnaam) and ‘artikelverkoopprijs’ (label: orderdetailsprijs) are shown. Both fields are of the type ‘select’. The SQL of the field ‘artikelnaam’ is:
SELECT artikelID, artikelnaam
FROM artikelen
ORDER BY artikelnaam
I also checked the box ‘Use AJAX to reload other fields of type Select, Double select, Radio and Checkbox’ in the block ‘AJAX Events’ and turned the asterisk on for the value ‘orderdetailprijs’ wich is the title (not the field-name) of the second field.
In the second field (orderdetailprijs) I put the following SQL:
SELECT artikelID, artikelverkoopprijs
FROM artikelen WHERE artikelID = ‘{artikelnaam}’
ORDER BY artikelverkoopprijs
When running the form, the values in the first field (artikelnaam) are correctly showed, but when I select an product, the value in the second field (artikelverkoopprijs) should change automatically to the value belonging to the product (artikelnaam). But the second select-box is empty. No values are shown. Please also check the attachments (screenshots).
What did I do wrong and how can i make this work?
Thanks in advance!