@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.
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.
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
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.
Thx that works perfectly.