It’s important to remember that not all browsers support all types. Other than “password” the other types are mainly exposed on mobile devices by way of changing the keyboard in use.
If for example I have a password field and I want to put a button that allows me to show or hide it, it does NOT work.
if txtAccesoClave.FieldType = WebTextField.FieldTypes.Password then
txtAccesoClave.FieldType = WebTextField.FieldTypes.Normal
else
txtAccesoClave.FieldType = WebTextField.FieldTypes.Password
end if
If Self.TextField9.FieldType = WebTextField.FieldTypes.Password Then
Self.TextField9.FieldType = WebTextField.FieldTypes.URL
Else
Self.TextField9.FieldType = WebTextField.FieldTypes.Password
End If
Parece ser que .Normal sencillamente no genera el cambio a tipo “Text”
In some browsers, you can’t change the field type to/from the actual password type at runtime. Websites that offer this usually use CSS trickery to make the field look like a password field when they’re really not.
Inspecting this process as it occurs in the DOM – and stepping through the update and render functions in JavaScript – it doesn’t look like the Xojo JavaScript framework actually changes the type of the field in Chrome on macOS. I worked up a simple WebTextField subclass to illustrate how this switching can be done using JavaScript. This could be modified to account for all other field types.