Javascript getElementById Issue in Firefox
July 12, 2008
I'm working on an Javascript code. This web application is retrieving value from a couple of textbox fields and concatenate in result textbox field. I tested the web application in Internet Explorer and it work fine. But when I'm testing in Firefox, the value is not passed to the textbox field.
Here is the original code:
-
<HTML>
-
<HEAD>
-
<TITLE> Addition </TITLE>
-
<SCRIPT LANGUAGE="JavaScript">
-
<!--
-
function GetFullName()
-
{
-
document.getElementById('FullName').value = document.getElementById('FirstName').value + " " + document.getElementById('LastName').value
-
}
-
//-->
-
</SCRIPT>
-
</HEAD>
-
-
<BODY>
-
First Name:<INPUT TYPE="text" NAME="FirstName"><br/>
-
Last Name:<INPUT TYPE="text" NAME="LastName"><br/>
-
<INPUT TYPE="button" align="right" VALUE="Get Full Name" ONCLICK="GetFullName()"><br/>
-
Full Name:<INPUT TYPE="text" NAME="FullName">
-
</BODY>
-
</HTML>
The workaround to this issue is to define the id property of all the textbox fields. See the updated code below:
-
<HTML>
-
<HEAD>
-
<TITLE> Addition </TITLE>
-
<SCRIPT LANGUAGE="JavaScript">
-
<!--
-
function GetFullName()
-
{
-
document.getElementById('FullName').value = document.getElementById('FirstName').value + " " + document.getElementById('LastName').value
-
}
-
//-->
-
</SCRIPT>
-
</HEAD>
-
-
<BODY>
-
First Name:<INPUT TYPE="text" NAME="FirstName" ID="FirstName"><br/>
-
Last Name:<INPUT TYPE="text" NAME="LastName" ID="LastName"><br/>
-
<INPUT TYPE="button" align="right" VALUE="Get Full Name" ONCLICK="GetFullName()"><br/>
-
Full Name:<INPUT TYPE="text" NAME="FullName" ID="FullName">
-
</BODY>
-
</HTML>
Displaying Posts Using a Custom Select Query
September 22, 2007
The practical example, outlined below, demonstrates a process of selecting all posts with a particular Custom Field value stored, and displaying them in a Page based on a Page Template.
http://codex.wordpress.org/Displaying_Posts_Using_a_Custom_Select_Query
Customized Query in Wordpress
September 18, 2007
-
<?php
-
$get_children = $wpdb->get_results('SELECT * FROM your category table WHERE category_parent = "The cat_ID of the parent that you want"');
-
foreach ($get_children as $child) {
-
}
-
?>
-
</ul>
SEO URL Rewriting for GARS
August 19, 2007
I discussed the steps to setup the URL rewriting for VBulletin. For those forums using GARS, here are the steps.
- Edit geek/gars/mods/display/top.php
Search:CODE:-
$bits .= "<tr><td align=\"$stylevar[left]\"><span class=\"smallfont\"><a href=\"showthread.php?t=$value[threadid]\" title=\"$value[title]\">$value[title]</a></span></td></tr>";
Replaced with
CODE:-
$thread['url'] = strtolower(str_replace(" ", "-", $value[title]));
-
$thread['url'] = strtolower(str_replace("'", "", $value[title]));
-
$thread['url'] = ereg_replace("[/?!.$%£()~*@#]+", "", $thread['url']);
-
$bits .= "<tr><td align=\"$stylevar[left]\"><span class=\"smallfont\"><a href=\"t$value[threadid]-" . $thread['url'] . ".html\" title=\"$value[title]\">$value[title]</a></span></td></tr>";
-
- Edit geek/gars/mods/display/toc.php
CODE:-
$bits.="<li><div class=\"smallfont\"><a href=\"showthread.php?t=$threadinfo[threadid]&garpg=" . ($toc_x + 1). "#content_start\">";
-
$bits.=$this->navigation['pages'][$toc_x]['text'] ? $this->navigation['pages'][$toc_x]['text'] : construct_phrase($vbphrase['GARS_pagex'],($toc_x + 1));
-
$bits.="</a></div></li>";
Replaced with
CODE:-
$thread['url'] = strtolower(str_replace(" ", "-", $this->navigation['pages'][$toc_x]['text'] ? $this->navigation['pages'][$toc_x]['text'] : construct_phrase($vbphrase['GARS_pagex'],($toc_x + 1))));
-
$thread['url'] = ereg_replace("[/?!.$%£()~*@#]+", "", $thread['url']);
-
$bits.="<li><div class=\"smallfont\"><a href=\"a$threadinfo[threadid]-" . ($toc_x + 1). "-$thread[url].html\">";
-
- Edit the following templates
GARS_forumbit_level1_nopost
GARS_forumbit_level1_post
GARS_forumdisplay
GARS_simple_threadbit
GARS_subforumbit_nopost
GARS_subforumbit_post
GARS_threadbitReplace:
CODE:-
showthread.php?$session[sessionurl]t=$thread[threadid]
with
CODE:-
t$thread[threadid]-$thread[url].html
-
VBulletin SEO URL Rewriting
August 19, 2007
- Place the code below in the .htaccess.
CODE:
-
RewriteRule ^t([0-9]+)-(.*).html$ showthread.php?t=$1 [L]
-
RewriteRule ^lastpostinthread([0-9]+).html$ showthread.php?goto=lastpost&t=$1 [L]
-
RewriteRule ^newpostinthread([0-9]+).html$ showthread.php?goto=newpost&t=$1 [L]
-
RewriteRule ^f([0-9]+)-(.*).html$ forumdisplay.php?forumid=$1 [L]
-
- Edit the functions_forumlist.phpSearch for:
CODE:
-
$forum['statusicon'] = fetch_forum_lightbulb($forumid, $lastpostinfo, $forum);
and below that add
CODE:-
$forum['url'] = strtolower(str_replace(" ", "-",str_replace("/", "-", $forum['title'])));
-
$forum['url'] = strtolower(str_replace("'", "",str_replace("/", "-", $forum['title'])));
-
- Edit the forumdisplay.php.Search for:
CODE:
-
$thread = process_thread_array($thread, $lastread, $foruminfo['allowicons']);
and below that add
CODE:-
$thread['url'] = strtolower(str_replace(" ", "-", $thread['threadtitle']));
-
$thread['url'] = strtolower(str_replace("'", "", $thread['threadtitle']));
-
$thread['url'] = ereg_replace("[/?!.$%£()~*@]+", "", $thread['url']);
-
- Edit the threadbit template.Search for:
CODE:
-
<a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]">
and below that add
CODE:-
</a><a href="t$thread[threadid]-$thread[url].html">
-
- Change the following template:
Search the following:CODE:Replace with:-
</a><a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">
CODE:-
</a><a href="$forum[url].html">
-
VBulletin URL Rewriting
August 18, 2007
This discussed how to make the VBulletin URL to a human readable format.
NoSpam! - an alternative to CAPTCHA images
August 18, 2007
This simple hack is meant as a replacement for the default CAPTCHA system in vBulletin. There are two main reasons one might want to do this: firstly, new technology is constantly being developed to crack CAPTCHA images and make spam accounts anyway, and secondly, the more secure the CAPTCHA, the more difficult it is for genuine users to tell what the numbers in the image are. There is also the issue of visually impaired users, and the fact that not all servers are capable of generating CAPTCHA images.
VBulletin Specific Category Icon
August 18, 2007
Find "forumhome_forumbit_level1_nopost" template:
Code:
<td class="tcat"><img src="/path/to/your/image_$forum[forumid].gif" /></td>
Then, when you're naming the images you'd like to display, add a suffix to each one with the Forum ID that you'd like it displayed for.
Ex: image.gif for Forum ID 2 becomes - image_2.gif
Edit: If you don't want to display an image for all your forums, you can wrap the above code with the following, which will only display it for specific forums:
Code:
<if condition="in_array($forum[forumid], array(X,Y,Z))"> Code Supplied Above </if>
Replace X,Y,Z with the Forum IDs of the forums you're displaying images next to.
AJAX Tutorials
August 11, 2007
Commonly Asked VBulletin Questions
August 11, 2007
As you hop around vB Forums, help compile listings of the most commonly asked questions (and answers) related to these 14 topic groupings. Goal is to provide a Browse by Topic method of locating frequently requested information, as a companion to Search Mode. An FAQ will be produced from these results. Thanks for your help!
1. FORMATTING. LAYOUT. THREAD DISPLAY ISSUES
2. REPLYING. START THREAD. COMPOSE, EDIT MESSAGE
3. IMAGES. ATTACHMENTS. SIGS. AVATARS
4. USER STATUS. PRIVILEGES. DISPLAYS. PROFILE. PREFS
5. REGISTRATION. NOTIFICATION ISSUES
6. LOGIN. COOKIES. SESSIONS. TRACKING. STATS
7. RATINGS. RANKINGS. KARMA. FILTRATION
8. ADMIN CONTROL PANEL. TEMPLATE EDITS.
9. MODERATOR TOOLS
10. PRIVATE FORUMS
11. PMs (PRIVATE MSGS). ICQ. CHATS. CALENDAR
12. NON-vB PAGES. TOP 10. MOST RECENT POSTS
13. SEARCH. mySQL. QUERIES. DATABASE. BACKUPS
14. MISCELLANEOUS. CROSSOVER TOPICS. UPGRADES. INSTALLS





Recent Comments