Javascript QR codes - is this even possible?

karen

Member
I would like to create an after insert hook, so that when a record has been added and saved, a QR code is generated, and saved to the "qr_code" field of the current record as an image (currently they are created and uploaded separately). The contents of the qr code would be https://xxxxxxxx.co.uk/index.php?tablename=Hoses&function=details&where_field=id&where_value=2 so that scanning it would bring the user to the page of the record. I've played around with some AI to try and create something, but before I mess about, I just want to know if it would actually be possible?
 

eugenio

Administrator
Staff member
Technically, (almost) everything is possible if you code it :)
Is there any reason why you want to store the created image in a DB field instead of storing it in the file system as DaDaBIK normally does?
 

karen

Member
Hi Eugenio, sorry maybe I didn't explain it properly, the image will be stored in the uploads folder, but the name of the image will be stored in the field, if that makes sense.
 

eugenio

Administrator
Staff member
Ok, then, for DaDaBIK, it would be an image as any other one, the field type should be image_file. You just need to code the generation of the picture.

best,
 

karen

Member
Hi Eugenio, ok I got this working with a custom "generate qrcode" button instead. It doesn't really need be stored, as it can be instantly generated and downloaded if the user needs to save it to make a qr label for the product. Thanks for the advice!!
 
Top