Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript jscript help(form validation)

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #157041
    javascriptnewbie
    Participant

    this code doesnt seem to be working, label shows fora second then its gone

    function validate(){

    getUser=document.getElementById(“username”);
    getLabel=document.getElementById(“labelUser”);

    if
    (getUser.value.length>=5){
    getLabel.innerHTML=”Valid username”;
    getLabel.style.color=”green”;
    return true;
    }

    else{
    getLabel.innerHTML=”invalid username”;
    getLabel.style.color=”red”;
    return false;
    }

    #157132
    Paulie_D
    Member

    Could you provide a Codepen?

    Or a link?

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.