Ajax Refresh limpa um Input Password

Ajax Refresh limpa um Input Password

  

Boa tarde!

Sempre que utilizo um Ajax Refresh em um input Password, o campo é limpado.

Existe alguma forma de fazer com que ao atualizar o campo, não perder texto digitado?

Obrigado!

Hi Christian,

Please use English language in this forum.

Please share the sample oml.

Why you are refreshing your input password field?

Thanks,

Manish Jawla

Hi Christian,

First of all, we would appreciate if you could ask in English, given the majority of the people in the forums don't speak Portuguese. Also English is the language of this community. 

For security reasons, inputs of type password are treated differently than other form controls since it stores sensitive information. At server side, for every postback the password textbox is force-fully cleared for this reason, should you really need to persist the value in password text-box, setting it explicitly. But I really don't recommend doing this since it's not a good practice.


Regards,

André Siébra

André,

I want to do this in this situation: When, in a password text-field, I type a wrong password, the text-field border color changes to red and shows an error message. But when I retype the password correctly, the red border and the error message don't disappear. To make them desappear I'm refreshing the text-box widget, but when I do this the password is cleared. I need to do this process using an Ajax Refresh Action, because it's a validation of the password.

Regards,

Christian Tavares

Solution

Christian, you need to do this via javascript. If you refresh the widget it will cause a postback. Try to execute client side validations. For example, in the onchange javascript event of the input (extended property), you can call a function that clears the message and css error styles.

Solution

Thanks André.