How to restore password TextBox

Discussion in 'ASP .Net' started by Amil Hanish, Apr 7, 2004.

  1. Amil Hanish

    Amil Hanish Guest

    I have a form with 5 TextBox controls. One of them is a password TextBox.
    When the form is submitted, one of the other fields might have an invalid
    format; on the repost showing the error in the other field, I want to
    restore the password value into the password TextBox...without the user
    re-entering it.

    Seems like, by default, a password TextBox is blank on a repost. How can I
    automatically reset the TextBox so that it has ***** in it, but the value is
    the original password entered by the user?

    Amil
    Amil Hanish, Apr 7, 2004
    #1
    1. Advertising

  2. It's this way by default for security reasons. If you populate the password textbox prior to sending it to the client broswer it will leave the password exposed in the source of the html document

    There's a way to get around it using Javascript but as I mentioned above it will leave the password exposed

    Also it's normal for web forms that have secured fields to have the user refill the secure information if the original submit fails

    HTH
    Suresh

    ----- Amil Hanish wrote: ----

    I have a form with 5 TextBox controls. One of them is a password TextBox
    When the form is submitted, one of the other fields might have an invali
    format; on the repost showing the error in the other field, I want t
    restore the password value into the password TextBox...without the use
    re-entering it

    Seems like, by default, a password TextBox is blank on a repost. How can
    automatically reset the TextBox so that it has ***** in it, but the value i
    the original password entered by the user

    Ami
    =?Utf-8?B?U3VyZXNo?=, Apr 7, 2004
    #2
    1. Advertising

  3. Amil Hanish

    Joe Gass Guest

    some thing like

    txtPassword.attributes.add("value","thepassword")

    "Amil Hanish" <> wrote in message
    news:...
    > I have a form with 5 TextBox controls. One of them is a password TextBox.
    > When the form is submitted, one of the other fields might have an invalid
    > format; on the repost showing the error in the other field, I want to
    > restore the password value into the password TextBox...without the user
    > re-entering it.
    >
    > Seems like, by default, a password TextBox is blank on a repost. How can

    I
    > automatically reset the TextBox so that it has ***** in it, but the value

    is
    > the original password entered by the user?
    >
    > Amil
    >
    >
    Joe Gass, Apr 8, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark
    Replies:
    0
    Views:
    462
  2. jong yoon

    restore command error in modelsim

    jong yoon, Apr 9, 2004, in forum: VHDL
    Replies:
    0
    Views:
    590
    jong yoon
    Apr 9, 2004
  3. John Sparrow
    Replies:
    0
    Views:
    387
    John Sparrow
    Jul 1, 2003
  4. AAaron123
    Replies:
    2
    Views:
    2,097
    AAaron123
    Jan 16, 2009
  5. AAaron123
    Replies:
    1
    Views:
    1,316
    Oriane
    Jan 16, 2009
Loading...

Share This Page