how to change textfield value on validation time?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nitya Kumar
    New Member
    • Mar 2012
    • 6

    how to change textfield value on validation time?

    i want to change text field value
    document.getEle mentById('id'). innerHTML.value ="email is invalide....";


    why its not working ?
    and any other idea for changing value on validation time without page reload..
    Last edited by acoder; Sep 24 '12, 11:14 AM.
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    it’s not working because
    - innerHTML is a String and Strings do not have a value property
    - a text field does not have an innerHTML property

    Comment

    • Nitya Kumar
      New Member
      • Mar 2012
      • 6

      #3
      Dromilich

      thanks
      but any other suggestion pls

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        see https://developer.mozilla.org/en-US/...MLInputElement for a full list of supported properties.

        Comment

        • iam_clint
          Recognized Expert Top Contributor
          • Jul 2006
          • 1207

          #5
          .innerHTML.valu e isn't valid its just .value
          Code:
          document.getElementById('id').value="ema il is invalide....";

          Comment

          Working...