printing a message on top of the login page....

in some website if the login fails a message"login failed" is displayed on the login page itself.........

in this case should we create a copy of the login page with this message displayed on it and redirect the user to the new page?means we have to duplicate this page and add a message in it....

is there any other way to do this?i have no idea about it....please help me

[392 byte] By [relnaa] at [2007-11-27 11:24:21]
# 1

Just render the messages conditionally?

BalusCa at 2007-7-29 15:57:47 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

hi,

use document.getElementById("id").innerHTML = "value"

refer about : innerHTML

you can get what you want,,'

no need to copy of your file

drvijayy2k2a at 2007-7-29 15:57:47 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

[nobr]hi,

take this example

<html>

<script language="javascript">

function checkNull ()

{

if ( document.f.t1.value == "" )

{

document.getElementById("error").innerHTML = "Error : Must enter value.. <br>";

return false;

}

return true;

}

</script>

<body>

<form action="second.html" name="f">

<table border="1" width="20%">

<tr>

<td>

<font id="error" color="red" size="2"> </font>

<input type="text" name="t1">

</td>

</tr>

<tr><td>

<input type="submit" onClick="return checkNull()"></td>

</tr>

</form>

<body>

</html>

[/nobr]

drvijayy2k2a at 2007-7-29 15:57:47 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

If you want to do it with JS+DOM for some reasons, please don't use innerHTML. It's an IE proprietaty (you have no guarantee that it will work in alternative useragents) and it is relatively slow (especially in bigger document trees). Gently use firstChild.nodeValue instead.

BalusCa at 2007-7-29 15:57:47 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...