• Resolved ftpwp

    (@ftpwp)


    Hi,

    The issue is on the Registration form, during the registration process, when after a Submit, there’s an error and the form is reloaded to display error message(s).

    Normally, all values set before the Submit are kept and displayed in the reloaded form (except password and reCaptcha).
    But there’s a bug with one type of values that are not displayed on the reloaded form, values from dropdown field for which its choices are populated vie a Choices Callback function. The value of those fields are not kept and displayed on the reloaded registration form.

    Is there a fix?
    I saw you are working on bugs around Choices Callback fields for the next release, maybe you can add this bug in the package of fixes!

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Ultimate Member Support

    (@ultimatemembersupport)

    Hi @ftpwp,

    Thanks for letting us know about this issue.
    Can you please attach the screenshots of this issue, your form layout, and registration page so we can replicate this issue on our end.

    Let us know.
    Regards.

    Thread Starter ftpwp

    (@ftpwp)

    Can you provide an email (I can send you a link)?

    Thread Starter ftpwp

    (@ftpwp)

    The layout is:

    Row 1
    First name | Last name

    Raw 2
    Address (parent) | Floor (Custom callback)

    Raw3
    Username | Password
    Email | Password confirmation

    Raw 4
    Agreement (checkbox)

    Here is the screenshot…
    https://ibb.co/jwT02d5

    I fill in all the fields except didn’t put any password (Mot de passe), submit and the floor (Etage) is lost when the page is reloaded.

    And the callback function is:

    function getFloors() {
    	//Get the value from the 'parent' field, sent via the AJAX post.
    	$choice = $_POST['parent_option'];
    
    	//Depending on the value of $choice, return a different array.
    	switch($choice) {
    		case "18 rue Henry Bordeaux":
    		case "20 rue Henry Bordeaux":
    			$floors = [
    				"RDC" =>"RDC",
    				"1er" => "1er",
    				"2nd" => "2nd",
    				"3ème" => "3ème",
    				"4ème" => "4ème",
    				"5ème" => "5ème",
    				"6ème" => "6ème"
    			];
    			break;
    		case "22 rue Henry Bordeaux":
    		case "24 rue Henry Bordeaux":
    			$floors = [
    				"RDC" =>"RDC",
    				"1er" => "1er",
    				"2nd" => "2nd",
    				"3ème" => "3ème",
    				"4ème" => "4ème",
    				"5ème" => "5ème",
    				"6ème" => "6ème",
    				"7ème" => "7ème",
    				"8ème" => "8ème"
    			];
    			break;
    		case "44 avenue Gambetta":
    			$floors = [
    				"RDC" =>"RDC",
    				"1er" => "1er",
    				"2nd" => "2nd",
    				"3ème" => "3ème",
    				"4ème" => "4ème",
    				"5ème" => "5ème",
    				"6ème" => "6ème",
    				"7ème" => "7ème",
    				"8ème" => "8ème",
    				"9ème" => "9ème",
    				"10ème" => "10ème"
    			];
    			break;
    		default:
    		//code to do something if other options are not selected (throw an error, or set $floors to a default array)
    		$floors = ["Sélectionnez une adresse"];
    
    	}
    	return $floors;
    
    }
    Thread Starter ftpwp

    (@ftpwp)

    Hi,

    Guys, the ticket has been closed 10mn ago but the issue is NOT fixed with the last version! (2.0.56)
    https://github.com/ultimatemember/ultimatemember/issues/580

    Can you give an update and re-open the ticket please?
    Thanks!

    Thread Starter ftpwp

    (@ftpwp)

    Fixed in version 2.1.0!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Choices Callback field values not kept when registration form is reloaded’ is closed to new replies.