• Resolved medyapin

    (@medyapin)


    I added a custom signup field as how its described in guide. Actually added same sample with changing only icon.png url.

    var options = {
    additionalSignUpFields: [{
    name: “address”,
    placeholder: “enter your address”,
    // The following properties are optional
    icon: “icon url”,
    prefill: “street 123”,
    validator: function(address) {
    return {
    valid: address.length >= 10,
    hint: “Must have 10 or more chars” // optional
    };
    }
    },
    {
    name: “full_name”,
    placeholder: “Enter your full name”
    }]
    }

    I cant see it on signup tab. I do not use universal login page.

    • This topic was modified 7 years, 7 months ago by medyapin.
Viewing 6 replies - 1 through 6 (of 6 total)
  • @medyapin – do you have any errors in your JS console when you load the login form? If you’re using exactly what you’re quoting above then you’ll want to remove everything except the array itself. The options assignment and signup fields property is handled for you.

    Thread Starter medyapin

    (@medyapin)

    If you mean directly use like this;

    {
    name: “company_name”,
    placeholder: “enter your company name”,
    prefill: “Your Company Name”,
    validator: function(company_name) {
    return {
    valid: company_name.length >= 3,
    hint: “Must have 3 or more chars”
    };
    }
    }

    it doesnt work. or code i wrote is wrong but i couldnt recognise it.

    • This reply was modified 7 years, 7 months ago by medyapin.
    Thread Starter medyapin

    (@medyapin)

    I get name error changed it again same error.

    <script type=”text/javascript”>var wpAuth0LockGlobalFields={
    name: “company”,
    placeholder: “enter your company name”,
    prefill: “Your Company Name”,
    validator: function(company) {
    return {
    valid: company.length >= 3,
    hint: “Must have 3 or more chars”
    };
    }
    };</script>

    login:36 Uncaught SyntaxError: Invalid or unexpected token
    load-scripts.php?c=0&load[]=jquery-core,jquery-migrate&ver=4.9.8:9 JQMIGRATE: Migrate is installed, version 1.4.1

    Thread Starter medyapin

    (@medyapin)

    inspector output from login page…

    It’s meant to be an example rather than something that works as-is. The field in WP is looking for an array of field objects, so you’ll need those brackets. Also, copying and pasting directly from a code sample might have artifacts you don’t want (like curly quotes in this case). Here’s one that should work directly:

    
    [
    	{
    		name: "address",
    		placeholder: "enter your address",
    		icon: "icon url",
    		prefill: "street 123",
    		validator: function(address) {
    			return {
    				valid: address.length >= 10,
    				hint: "Must have 10 or more chars" // optional
    			};
    		}
    	}
    ]
    
    • This reply was modified 7 years, 7 months ago by Josh C.
    Thread Starter medyapin

    (@medyapin)

    Thx that works perfectly.

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

The topic ‘Custom Signup field doesnt appear’ is closed to new replies.