Forum Moderators: open
What I have been trying to achieve is,
On my index.htm, I have a horizontal cell named "memberarea" which originally shows username & password input fields. After the user logs in, this area changes itself to a "Welcome Name, Lastname" field.
I want that this cell displays again the username and password input fields in case of the session of the user has expired.
I have tried it with the following code (within the Iframe in index.htm):
-----------------------------------------
<script>
if ("<%=session("LoginFirstName")%>" == "")
{
var m = " <p align="center">
<font style="font-size: 8pt; font-weight: 700" face="arial"> Username:</font>
<span style="font-size: 1pt">
<input type="text" name="uid" id="uid" size="14" style="width: 65; height: 17; font-size: 8pt"></span><font face="arial" style="font-size: 8pt">
</font><font style="font-size: 8pt; font-weight: 700" face="arial">Password:</font><font face="arial" style="font-size: 8pt">
</font><span style="font-size: 1pt">
<input type="password" name="pwd" id="pwd" maxlength="10" size="14" style="width: 65; height: 17; font-size: 8pt"></span><span style="font-size: 1px">
</span>
<input type="submit" value="Enter" name="B1" style="width: 35; height: 17; font-size:9px" onclick="return login()">";
window.parent.document.getElementById('memberarea').innerHTML=m;
}
</script>
--------------------------------------------------
This code gives me the error that on the 12xx'the line (which does not exist-the whole code is 5xx lines). there is a ";" missing which I could not found.
Any ideas how to achieve this?
Thank you for your comments
needs to be
var m = '<p align="center">'
+ '<font ... </font>'
...
the quotes do not extend past newline and use single quote if string contains double quotes.
Consider having two div's in memberarea
div1 containing m string, visible then no user
div2 containing welcome, visible when div1 not
As for line number, if there as other files involved check 12xx in them, IE not good at reporting correct file.