Hello all,this is my code:
i want when i call the [B]whatever function
i made this…but i want before showing this message to delete the previous message [B]if exist
how can i do that…the problem i think is in function remove_show_message…
any ideas?or how else can be done this???
[code=php]
function whatever(){
….
….
….
….
….
remove_show_message();
show_message(errors);
}
[code=php]
function show_message(errors) {
var ni = document.getElementById(‘valDiv’);
//var numi = document.getElementById(‘thevalValue’); this line may not be important
//var num = (document.getElementById(‘thevalValue’).value -1)+ 2; this line may not be important
//numi.value = num; this line may not be important
var newdiv = document.createElement(‘div’);
//var divIdName = ‘my’+num+’Div’; this line may not be important
//newdiv.setAttribute(‘id’,divIdName); this line may not be important
newdiv.innerHTML = errors;
ni.appendChild(newdiv);
}
function remove_show_message() {
XXXXXXXX //which would be the code here????
}
[code=html]
<input type=”hidden” value=”0″ id=”thevalValue”/>
<div id=”valDiv”></div>