El codigo del formulario es
Código HTML:
<form onsubmit="alertForm()" action="#"> <fieldset> <input onclick="deleteValue()" type="text" id="nameForm" value="Please enter your name here." /> </fieldset> <fieldset> <input type="submit" id="submitFormButton" value="Submit" disabled="disabled"/> </fieldset> </form>
Código HTML:
function alertForm(){ // Check if is empty the input and if not // print if(document.getElementById("nameForm").value == ""){ return false; } var name = document.getElementById("nameForm").value; //alert(timeprint()+name); document.getElementById("namedate").style.display = "initial"; document.getElementById("namedate").innerHTML = timeprint()+name; return false; }