Forum Replies Created
- AuthorPosts
patdundee
ParticipantHi Ally
Many thanks. I realised that about 30 minutes ago and used https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ script which sorted the issue out 🙂
I did originally run a search and replace script within phpmyadmin but that obviously did not change the serialized fields.
Many thanks for replying.
P.S. I will drop another coffee over for you guys soon 🙂
Kind regards
Patrickpatdundee
ParticipantHi Ally
I have solved the issue 🙂
Changed the code in each section from this
if (!$element->getForm()->getElement('iphorm_13_4')->isEmpty()) {
To this for 13_4
if (!$element->getForm()->getElement('iphorm_13_4')->isEmpty() && !$element->getForm()->getElement('iphorm_13_6')->isEmpty()) {
And from this for 13_6
if (!$element->getForm()->getElement('iphorm_13_6')->isEmpty()
To this
if (!$element->getForm()->getElement('iphorm_13_6')->isEmpty() && !$element->getForm()->getElement('iphorm_13_4')->isEmpty()
All working now 🙂
Kind regards
Patrickpatdundee
ParticipantOops, spoke to soon
This is the test site and url. There is a small issue that the required notice does not disappear and it retains the selected values in all fieldstest.trustedweddingsuppliers.co.uk/wedding-suppliers-services
The custom validators and custom required field are in place for Service and Keyword (13_4) and (13_6) respective
Here are the codes put n place
On functions.php
//Key Word Search function my_custom_required1($form) { $dropdown = $form->getElement('iphorm_13_4'); $text = $form->getElement('iphorm_13_6'); if (!$dropdown->isEmpty()) { $text->setRequired(false); } if (!$text->isEmpty()) { $dropdown->setRequired(false); } } add_action('iphorm_pre_validate_13', 'my_custom_required1'); //Validator for both fields above function my_custom_dropdown_validator1($valid, $value, $element) { if (!$element->getForm()->getElement('iphorm_13_4')->isEmpty()) { $element->addError('Please choose from this menu or search by keword only below. You cannot use both.'); $valid = false; } return $valid; } add_filter('iphorm_element_valid_iphorm_13_4', 'my_custom_dropdown_validator1', 10, 3); function my_custom_text_validator2($valid, $value, $element) { if (!$element->getForm()->getElement('iphorm_13_6')->isEmpty()) { $element->addError('Please either enter a keyword or use the drop down menu above only. You cannot use both.'); $valid = false; } return $valid; } add_filter('iphorm_element_valid_iphorm_13_6', 'my_custom_text_validator2', 10, 3); //End Validator //End Keyword Search
and the java as given above is on the form in a html field
Kind regards
Patrickpatdundee
ParticipantPerfect 🙂
It is amazing how you can cutomise this form. I have got quite a bit of customisation in place for them. Have to always make sure I have a back up of everything before i do form updates. (Just in case lol).
Many thanks
Patrickpatdundee
ParticipantHi Ally
That’s great (As always). Is there a way we can add to the to make them choose one or the other and not both?
Kind regards
Patrickpatdundee
ParticipantJust bought you a coffee on your coffee link 🙂
patdundee
ParticipantBingo
I can now start growing my hair again 🙂
Many thanks Ally
Kind regards
Patrickpatdundee
ParticipantHi Ally
Sorry to bother you. This is really doing my head in lol
I have tried every permutation i can thing of but i still end up with the same. The files always get dumped in the default iphorm year month folder
Here is what I have I have changed the field number i am calling from 15_68 to 15_30 which is also an image upload
function my_upload_path_1($path, $element) { $name = $element->getName(); if ($name == 'iphorm_15_30') { $path = $_SERVER['DOCUMENT_ROOT'].'/3/'; } return $path; add_filter('iphorm_upload_path_15', 'my_upload_path_1', 10, 2); }
Any ideas would be a great help 🙂
Many thanks
Patrickpatdundee
ParticipantWill do
Many thanks
patdundee
ParticipantMidas touch 🙂
That works just fine thanks
Patrick
patdundee
ParticipantHi Ally
I have tried the following code and also created a folder on the server call “3” I have given it full 0777 permissions and also set both User and Group to both ftpuser / ftpgroup and also tried www-data for both user and group but the file does not appear in the folder
function my_upload_path_1($path, $element) { $name = $element->getName(); if ($name == 'iphorm_15_68') { $path = '../../../3/'; } return $path; } add_filter('iphorm_upload_path_15', 'my_upload_path_1', 10, 2);
Have also tried setting the path as
$_SERVER['DOCUMENT_ROOT'].'/3/';
Still no file
🙂
Any ideas?PS I am of course using child theme functions page as i do for all other form changes
Many thanks- This reply was modified 9 years, 7 months ago by
Ally.
patdundee
ParticipantThat makes more sense now 🙂
patdundee
Participant🙂
patdundee
ParticipantHi Ally
The size is not functioning correctly on that one. Instead of showing the first 8 items it is only showing 1 but you can use cursor or mouse to scroll down and do multiples.
You can view here
http://test.trustedweddingsuppliers.co.uk/advertise-with-trusted-wedding-suppliers/
Scroll down and select Bronze from the Listing Type and the form will open
Move down to the 5th row and the second item in displayed as Business Area to see live preview
Kind regards
Patrickpatdundee
ParticipantGosh
I have quite a bit of custom code for the forms 🙂I do use WP_Session Manager to create wp_sessions for separate item names though
- This reply was modified 9 years, 7 months ago by
- AuthorPosts