- October 31, 2018 at 4:59 pm #27581jerkskiParticipant
I have a development question. What is the best way to add custom elements to a form? The example I have is I have a series of autocomplete search fields that I use to grab info from a mysql db using ajax, show the results in a text area field, then when I select one of the results it prepopulates the rest of the fields on the form where the data matches.
It works great. However, I think I may have added the custom code to a file that is less advantageous and appropriate. I added the code to the /includes/elements/text.php and textarea.php files. But when I view the source for the form, I see that the custom code I have implemented appears once for every text element on the form. I have roughly 52 text fields, so you can only imagine the amount of unnecessary code this has generated.
What is the best way to implement custom fields and code on a form that is more portable and has less impact on the quform source?November 2, 2018 at 6:03 pm #27592jerkskiParticipant
Here is a visual example of my autocomplete search so you can have a better idea of what I am trying to accomplish. I have 4 quform text fields that bring up search results below as you begin to type and it finds matches in the mysql database. As I said, it works great. However, placing the code in the elements php files obviously is not the best way to embed custom fields as it repeats my code 1 time for each text field on the form.
Do you have any suggestions?
Attachments:You must be logged in to view attached files.November 5, 2018 at 11:35 am #27608
- You must be logged in to reply to this topic.