I am using Chronoforms5 and I want to show a barcode from input field in thank you message. What should I do?
In addition to that, I am using Joomla 3.6.5 and I want to add a field in user details so that I can directly create a barcode without taking details in form everytime. In this case, input data is roll number of student. I want to generate barcode of their roll number on thank you message.
Thank You in advance, Special thanks to GreyHead in Advance.
Hi abhishekpatil ,
You can use PHP in a Custom Code action to create a barcode image. There's an example in this thread using Charles Schefford's barcode.php file - I couldn't find that on-line in a quick search but there's a similar library on GitHub here
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
Thank you so Much for your quick reply, Thats what I expected from you. I will try it just now. As I am unable to send PM to you now, I will post my reply here.
When I tried your solution, I found some following things-
1. It generating barcode on form (in attachment) , I want its code so that I can Show it anywhere like in Email or Thank you message or in PDF.
2. I dont want to generate random id, I just want barcode from input alphanumeric field.
Please do something...
Hi abhishekpatil ,
You don't need to use the part of the code that creates the random string. Just use the input value from the $form->data array.
Once you have saved the image then you can include that as an image link in an email (remember to use the full URL) or in the thank you message or PDF.
Can't I use it without saving on server?
Is it possible to directly generate in PDF or Thank you message?
Hi abhishekpatil ,
Possibly but I wouldn't try. You could use a cron job to delete any files after say 24 hours if storage is the problem.
If its simple for you to take inputt value from form and generate barcode then will you provide its code please?
Thank you for your continuous guidance.
To echo it out in a Thank you page it would be something like this
echo "<img src='".JURI::base()
Thank you for the code, I have some doubts,
1) $form->data array is not working in thank you page, something went wrong. I have attached the screenshot.
2)To echo it out in thank you page, which addition should I do in Form code? If its possible, will you provide that?
It should not random code. It should input alphanumeric field from which barcode should be generated in Destination i.e. in Thank you page or Email.
3)How can I save it on server so that I will able to give a link through HTML in Thank you page?
Sorry, the Thank You page action does not support PHP (I forget that); use a custom Code action instead.
Replace input_name in my example with the name of the input with the value you want to add to the barcode.
How can I save it on server so that I will able to give a link through HTML in Thank you page?
Hey I got something..
From your reply,
I got an idea that,
I can show last message as a custom code instead of 'Show message'.
I got success to show barcode from input.
But there is another problem. I need a print button which will print data.
I have added to it. But when I click on it, barcode dissapears from print. What should I do?
This seems to work OK
$path = JPATH_SITE.'/components/com_chronoforms5/uploads/barcodes/';
According to me,
this barcode is not in Image format, it is in form of php code, thats why it diappears on print action. What should I do?
what will happen if I saved barcode on server and placed its link? Will print function print it?
How can I do that?
How can I save barcode on server? And how to get its link? will you provide its code?
Please check my last post.
Surely your solution works very well, But how to echo it out in custom code? Provided code is just saving img file. How to show it?
How to echo out it?
2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for goods and services provided by ChronoEngine.com