New home › Forums › Visitor Generated Markers › General queries › VGM – Put custom fields first
Tagged: custom fields, VGM
- This topic has 4 replies, 2 voices, and was last updated 6 months, 4 weeks ago by Matthew.
-
AuthorPosts
-
February 23, 2023 at 9:07 pm #76477johnnyengMember
I’ve created four custom fields (firstname, lastname, name, email, phone) and I’d like to make them appear above the default fields on the Add your Marker form. Is this possible?
Please see attached. Thank you. 🙂Attachments:
You must be logged in to view attached files.johnnyeng
February 24, 2023 at 10:51 am #76487MatthewModeratorHi John,
Thank you for getting in touch with us, we do appreciate your time.
Yes this may be possible using some custom JS code, thus please may I ask if you would be open to providing me the link to your map and VGM form so that I may take a closer look?
I look forward to hearing back from you.
Kindest Regards,
MatthewFebruary 27, 2023 at 1:35 pm #76492johnnyengMemberThis reply has been marked as private.johnnyeng
February 27, 2023 at 1:43 pm #76507MatthewModeratorHi there,
Thank you for your response and time on this, I really appreciate it!
Thank you for the links, thus here is the custom JS code that will be needed:
jQuery(function($){ $(document).ready(function(){ let vgmForm = $('.wpgmaps_user_form'); if(vgmForm.length > 0){ let vgmFormTable = vgmForm.find('.wpgmza_table'); let titleInput = vgmFormTable.find('tr.wpgmza-title'); vgmForm.find('[data-custom-field-id]').each(function(){ let field = $(this); $(field).insertBefore(titleInput); }) titleInput.css('margin-top', '20px'); } }) })
Please may you save the above code into the Custom JS setting block (Maps -> Settings -> Advanced Settings)?
Once this has been done, please may you clear your browser cache and confirm if this helps?
Kindest Regards,
MatthewFebruary 27, 2023 at 8:05 pm #76510johnnyengMemberThis worked a treat! Thank you so much Matthew. I very much appreciate it.
johnnyeng
February 28, 2023 at 9:47 am #76512MatthewModeratorHi there,
Thank you for getting back to me and most valued time, I tremendously appreciate it!
I am most happy to hear that, and it was my great pleasure assisting you with this.
Please may you kindly consider reviewing our plugin at https://wordpress.org/support/plugin/wp-google-maps/reviews/#new-post?
It would really mean the world to me! And if possible, please could I kindly ask you to mention both your name and mine in the review for administrative purposes as this would be a tremendous help?
Should you ever require any further assistance, I am more than happy to help.
Have a fantastic day further!
Kindest Regards,
Matthew -
AuthorPosts
- You must be logged in to reply to this topic.