Welcome to Geeklog, Anonymous Wednesday, October 07 2026 @ 11:33 am EDT
Geeklog Forums
javascript?
bdefore
Anonymous
why is it that when i try to put this within my login username input form (in lib_common.php):
infocus="if(this.value=='name:')this.value='';"
... it causes a parse error?
16
21
Quote
Anonymous
Anonymous
Don't know how readable this will be, but here's the code I'm using: (if you'd like to check your own, it's lines 1191-1196 of lib_common.php)
$retval .= COM_startBlock($LANG01[47])
. '<p align="right"><form action="' . $_CONF['site_url'] . '/users.php" method="post">' . LB
. '<input type="text" size="10" name="loginname" value="' . $LANG01[21] . '" infocus="' . if(this.value=="name:"
this.value=""; . '">' . LB
. '<input type="password" size="9" name="passwd" value="asdfas"><br>' . LB
. "$LANG01[59] " . '<input type="submit" value="' . $LANG01[58] . '"></form></p>'
. COM_endBlock(COM_getBlockTemplate('user_block', 'footer'));
Of course, the troublemaking part is this:
infocus="' . if(this.value=="name:"
this.value=""; . '">' . LB
that's my attempt to 'escape out' of the php. i assume i'm missing something though because this isn't working either.
21
18
Quote
Anonymous
Anonymous
yep \' did it
26
18
Quote
All times are EDT. The time is now 11:33 am.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content