• Resolved perists

    (@perists)


    I made a form, added a select field with no options, I wrote the cde as says in https://www.easyregistrationforms.com/populating-dynamic-field-with-easy-registration-forms/ but in form view the options are not in the order i gave …???!!!

    
    add_filter('erforms_1448_{field_id}_load','dynamic_options',10,2);
    add_filter('erforms_1448_field-4F2yAVZG2lpFqiZ_load','dynamic_options',10,2);
    function dynamic_options($command,$form){
    	$command['on'] = array('field-4F2yAVZG2lpFqiZ'); 		// field ID on which this command will be executed.
    	//$command['default_value']= 'option2'; 						// Default value of the dropdown. It will be selected by default. (This is optional)
    	$command['options']= true; 									// This must be true
    	$command['data']= array(
    		"01" => "Ανατολική Μακεδονία και Θράκη",
    		"02" => "Αττική",
    		"03" => "Βόρειο Αιγαίο",
    		"04" => "Δυτική Ελλάδα",
    		"05" => "Δυτική Μακεδονία",
    		"06" => "Ήπειρος",
    		"07" => "Θεσσαλία",
    		"08" => "Ιόνιοι Νήσοι",
    		"09" => "Κεντρική Μακεδονία",
    		"10" => "Κρήτη",
    		"11" => "Νότιο Αιγαίο",
    		"12" => "Πελοπόννησος",
    		"13" => "Στερεά Ελλάδα"); 									// Dropdown options in key-value format.
    return $command;
    }
    

    https://photos.google.com/photo/AF1QipOzUDo0WslEk7kDyN-qPxHePD84k8YbJV2qAaPF

    How can I get parent select field value and depending on that fill a child select field?

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author easyregistrationforms

    (@easyregistrationforms)

    Can you please share a working URL to check? If not, then you can export the form and send it to [email protected]

    Thread Starter perists

    (@perists)

    I work locally … here is the export
    {"form":{"settings":{"form_desc":"","notifications":""},"fields":[{"type":"username","required":"1","label":"Username","description":"","placeholder":"","className":"form-control","pattern":"","maxlength":"","name":"field-gVxkIM24ha5svgN","addUserField":"","addUserFieldMap":"","icon":"","width":"12","uniqueID":"unique-PYyz1WIRc3juhyX"},{"type":"text","value":"","label":"First Name","advance":"+ Advanced Settings","className":"form-control","name":"text-BBgRwX","addUserField":"1","addUserFieldMap":"first_name","uniqueID":"unique-PbTdMJ95lVFE8nx"},{"type":"user_email","required":"1","value":"","label":"User Email","advance":"+ Advanced Settings","className":"form-control","name":"text-fEsFh8","uniqueID":"unique-PwiJoPxZo1CuSG8"},{"type":"password","required":"1","value":"","label":"Password","advance":"+ Advanced Settings","placeholder":"","className":"form-control","name":"text-tW97v8","uniqueID":"unique-JvufZAtZpvLLbJD"},{"label":"Heading","type":"header","subtype":"h1","dataRefLabel":"ref-vpaQ8cKd","dataRefId":"ref-mJjEymEj","dataNonInput":"1","className":"","width":"12","uniqueID":"unique-LqYtCcoVDAATgN7"},{"label":"Region","type":"select","values":[{"label":"Label","value":"Value","selected":"","uniqueID":"option-M7wgxm4MixOQCla"}],"className":"","name":"field-4F2yAVZG2lpFqiZ","description":"","placeholder":"","addUserField":"1","addUserFieldMap":"","required":"","multiple":"","icon":"","width":"12","value":"","uniqueID":"unique-RHs3EX4MNSh8Uib"},{"label":"State","type":"select","values":[{"label":"Label","value":"Value","selected":"","uniqueID":"option-Y71qzSoteLlFg2H"}],"className":"form-control","name":"field-ZxcdHktmBwPJVr1","description":"","placeholder":"","addUserField":"","addUserFieldMap":"","required":"","multiple":"","icon":"","width":"12","value":"","uniqueID":"unique-czvojcN0Fmwsr74"},{"label":"Country","type":"country","values":[],"className":"form-control","name":"field-qn1pNTfBJGdmYgF","description":"","placeholder":"","addUserField":"","addUserFieldMap":"","required":"","multiple":"","icon":"","width":"12","value":"","uniqueID":"unique-0sTBpfbfusWHBwG","isNew":"1"},{"label":"State \/ Province","type":"state","values":[],"className":"form-control","name":"field-TJq0AdUDTipPb1i","description":"","placeholder":"","addUserField":"","addUserFieldMap":"","required":"","multiple":"","icon":"","width":"12","value":"","uniqueID":"unique-m50npffYFPe3ZyQ","isNew":"1"},{"label":"City","type":"city","className":"form-control","name":"field-1DuBWZ5T09nDJnh","value":"","description":"","placeholder":"","maxlength":"","masking":"","pattern":"","addUserField":"","addUserFieldMap":"","enableUnique":"","required":"","icon":"","width":"12","uniqueID":"unique-SJROvilnRBYkPrv","isNew":"1"},{"label":"Street Address1","type":"street1","className":"form-control","name":"field-5rtBLDOjbaJIgEr","value":"","description":"","placeholder":"","maxlength":"","masking":"","pattern":"","addUserField":"","addUserFieldMap":"","enableUnique":"","required":"","icon":"","width":"12","uniqueID":"unique-JKJHq9hDhDK2SuA","isNew":"1"},{"label":"Street Address2","type":"street2","className":"form-control","name":"field-a8rNZyGz5tLV3Ny","value":"","description":"","placeholder":"","maxlength":"","masking":"","pattern":"","addUserField":"","addUserFieldMap":"","enableUnique":"","required":"","icon":"","width":"12","uniqueID":"unique-ZqQQOjehQ1Qcf5I","isNew":"1"},{"label":"Postcode \/ Zip","type":"zip","className":"form-control","name":"field-CSg1tGiSWVzLdR3","value":"","description":"","placeholder":"","maxlength":"","masking":"","pattern":"","addUserField":"","addUserFieldMap":"","enableUnique":"","required":"","icon":"","width":"12","uniqueID":"unique-RGh1Z8eV0QYRthS"},{"type":"button","subtype":"submit","label":"Register","className":"btn btn-default","name":"button-uYPdus","style":"default","uniqueID":"unique-Bz9HKnILpZoR9eq"}],"title":"Profile F","type":"reg","default_role":"subscriber","auto_user_activation":"1","access_roles":[],"auto_reply":"Thank you for registering with us. You will soon receive an account activation email. After that you can log into our website through login page.","enable_external_url":"0","external_url":"","enable_limit":"0","auto_login":"0","limit_by_date":"","limit_by_number":"0","limit_type":"date","enable_login_form":"0","login_and_register":"0","enabled_auto_reply":"1","enable_admin_notification":"1","admin_notification_msg":"Hello Admin,<br> You have received a new submission. Here are the details: <br><br> {{REGISTRATION_DATA}}","enable_act_notification":"1","user_act_subject":"Account Activation","user_act_msg":"Your account has been activated successfully.","auto_reply_subject":"Profile F Registration","admin_notification_from":"","admin_notification_from_name":"","unique_id_gen_method":"auto","unique_id_padding":"0","unique_id_offset":"1","unique_id_index":"1","unique_id_prefix":"","recaptcha_enabled":"0","enable_unique_id":"0","redirect_to":"","label_position":"top","layout":"one-column","field_style":"rounded-corner","access_denied_msg":"You are not authorised to access this form.","plan_enabled":"0","limit_message":"Form submission limit reached.","admin_notification_to":"","en_pwd_restriction":"0","pwd_res_description":"Please answer the question to access the form.","pwd_res_question":"Your Password","pwd_res_err":"Incorrect password.","pwd_res_en_logged_in":"0","pwd_res_answer":"","auto_reply_from":"","auto_reply_from_name":"","reports":[],"auto_reply_msg":"Hello,<br>Thank you for registering with us.","admin_notification_subject":"New Submission","before_form":"Register with us by filling out the form below.","role_choices":[],"role_choice_position":"","success_msg":"Thank you for registering with us!","user_act_from":"","user_act_from_name":"","allow_re_register":"1","en_email_verification":"0","user_acc_verification_msg":"Your account has been verified. <br> [erforms_my_account]","en_user_ver_msg":"0","user_ver_from":"","user_ver_from_name":"","user_ver_subject":"Account Verification","user_ver_email_msg":"Your account is not activated yet. Please follow below given link to activate your account : <br> {{verification_link}}","after_user_ver_page":"0","auto_login_after_ver":"0","show_before_login_form":"0","auto_reply_to":"","primary_field":"","primary_contact_name_field":"","allow_single_plan":"0","payment_header":"Payment Details","plans":{"enabled":[],"required":[]},"enable_edit_notifications":"0","edit_sub_user_email":"Your submission edited successfully.","edit_sub_user_from":"","edit_sub_user_from_name":"","edit_sub_user_subject":"Submission Edited","edit_sub_admin_email":"Edit Submission Details are : {{REGISTRATION_DATA}}","edit_sub_admin_from":"","edit_sub_admin_from_name":"","edit_sub_admin_subject":"Submission Edited","edit_sub_admin_list":"","enable_delete_notifications":"0","delete_sub_user_email":"Your submission deleted successfully.","delete_sub_user_from":"","delete_sub_user_from_name":"","delete_sub_user_subject":"Submission Deleted","delete_sub_admin_email":"Deleted Submission Details are : {{REGISTRATION_DATA}}","delete_sub_admin_from":"","delete_sub_admin_from_name":"","delete_sub_admin_subject":"Submission Deleted","delete_sub_admin_list":"","form_admin_list":"","en_edit_sub":"0","allow_sub_deletion":"0","edit_fields":[],"opt_in":"0","opt_text":"Subscribe for emails","opt_default_state":"0","limit_time":"","sub_columns":[],"dis_mul_sub":"0","mul_sub_denial_msg":"You have already submitted this form.","id":1448}}

    Thread Starter perists

    (@perists)

    Can i make a profile form?

    Plugin Author easyregistrationforms

    (@easyregistrationforms)

    @perists,

    Below code works fine at our end:

    add_filter(‘erforms_1448_field-4F2yAVZG2lpFqiZ_load’,’dynamic_options’,10,2);
    function dynamic_options($command,$form){
    $command[‘on’] = array(‘field-4F2yAVZG2lpFqiZ’);
    $command[‘options’]= true;
    $command[‘data’]= array(
    “01” => “Ανατολική Μακεδονία και Θράκη”,
    “02” => “Αττική”,
    “03” => “Βόρειο Αιγαίο”,
    “04” => “Δυτική Ελλάδα”,
    “05” => “Δυτική Μακεδονία”,
    “06” => “Ήπειρος”,
    “07” => “Θεσσαλία”,
    “08” => “Ιόνιοι Νήσοι”,
    “09” => “Κεντρική Μακεδονία”,
    “10” => “Κρήτη”,
    “11” => “Νότιο Αιγαίο”,
    “12” => “Πελοπόννησος”,
    “13” => “Στερεά Ελλάδα”);
    return $command;
    }

    Please make sure that your form ID is “1448”. Otherwise, replace “1448” with the correct form ID.

    Regarding profile form, Popular WordPress plugins use WordPress user meta as their profile fields. You can map our form fields with the corresponding meta to create profile fields. Please check our blog: https://www.easyregistrationforms.com/custom-user-meta-fields/

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Populating Dynamic field order issue’ is closed to new replies.