Home › Forums › Quform WordPress › Developer Question – Custom Fields on Quform
- This topic has 2 replies, 2 voices, and was last updated 5 years, 5 months ago by Ally.
- AuthorPosts
- 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 #27592jerkskiParticipantHere 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 #27608AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
- AuthorPosts
- You must be logged in to reply to this topic.