Query in form_X javascript

Mono

Member
Hope someone can put me straight, I'm learning all sorts of new stuff here.

I understand that I can't query the database in Javascript, but I read that you can with jquery but I must admit it doesn't make sense to me and I can't find an example to learn from.

What I'm thinking to do is run a switch command based on the number of records in a table with a where clause. This would be the query I would use if I could.

Code:
SELECT COUNT(*)
FROM tbl_faults
WHERE fk_inspection_id = {tbl_inspections___id} AND im_id = {tbl_inspections___calc_im_id}

This is why I want to do this:
I have a pop up form that opens to enter, edit or view records, it has a repeat group and a parent group.

So when my user clicks 'new' it opens the pop up and puts in some predetermined values into fields and the user completes the 'fault description' and 'fault rectification' for an IM group lets say called 'engine'.

If my user saves this form and then wants to add another 'new record' to the 'engine group' (im_id), I want to check if there is already any 'fault description' and 'fault rectification' in the engine group and if there is get the rowid that already exists and add to that. Hopefully displaying a blank repeat group at the top of the previously entered records.

Same for viewing and editing but without the blank repeat group.
 
JavaScript:
https://fabrikar.com/forums/index.php?threads/retrieve-values-from-db-using-js.49015/#post-256364
Whit this sample code you can run query and get get data from db.
Change it according to your needs.
Another code examples:
JavaScript:
https://fabrikar.com/forums/index.php?threads/user-ajax-dropdown.49376/#post-257847
 
JavaScript:
https://fabrikar.com/forums/index.php?threads/retrieve-values-from-db-using-js.49015/#post-256364
Whit this sample code you can run query and get get data from db.
Change it according to your needs.
Another code examples:
JavaScript:
https://fabrikar.com/forums/index.php?threads/user-ajax-dropdown.49376/#post-257847


Thank you. I will get reading right away
 
JavaScript:
https://fabrikar.com/forums/index.php?threads/retrieve-values-from-db-using-js.49015/#post-256364
Whit this sample code you can run query and get get data from db.
Change it according to your needs.
Another code examples:
JavaScript:
https://fabrikar.com/forums/index.php?threads/user-ajax-dropdown.49376/#post-257847
Thanks startpoint this helped me work it out.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top