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:

CODE:
  1. <script>&lt;br /&gt;
  2.   &lt;!--&lt;br /&gt;
  3.   function GetFullName()&lt;br /&gt;
  4.   {&lt;br /&gt;
  5.       document.getElementById('FullName').value = document.getElementById('FirstName').value + " " + document.getElementById('LastName').value&lt;br /&gt;
  6.   }&lt;br /&gt;
  7.   //--&gt;&lt;br /&gt;
  8.   </script>
  9. First Name:<input name="FirstName" type="text" />
  10.  
  11. Last Name:<input name="LastName" type="text" />
  12.  
  13. <input onclick="GetFullName()" type="button" value="Get Full Name" />
  14.  
  15. Full Name:<input name="FullName" type="text" />

The workaround to this issue is to define the id property of all the textbox fields. See the updated code below:

CODE:
  1. <script>&lt;br /&gt;
  2.   &lt;!--&lt;br /&gt;
  3.   function GetFullName()&lt;br /&gt;
  4.   {&lt;br /&gt;
  5.       document.getElementById('FullName').value = document.getElementById('FirstName').value + " " + document.getElementById('LastName').value&lt;br /&gt;
  6.   }&lt;br /&gt;
  7.   //--&gt;&lt;br /&gt;
  8.   </script>
  9. First Name:<input id="FirstName" name="FirstName" type="text" />
  10.  
  11. Last Name:<input id="LastName" name="LastName" type="text" />
  12.  
  13. <input onclick="GetFullName()" type="button" value="Get Full Name" />
  14.  
  15. Full Name:<input id="FullName" name="FullName" type="text" />

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

HTML:
  1. <?php
  2. $get_children = $wpdb->get_results('SELECT * FROM your category table WHERE category_parent = "The cat_ID of the parent that you want"');
  3. foreach ($get_children as $child) {
  4. echo '<li><a href="./?cat='.$child->cat_ID.'" title="View all posts filed under '.$child->cat_name.'">'.$child->cat_name.'</a></li>';
  5. }
  6. ?>
  7. </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.

  1. Edit geek/gars/mods/display/top.php

    Search:

    CODE:
    1. $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:
    1. $thread['url'] = strtolower(str_replace(" ", "-", $value[title]));
    2. $thread['url'] = strtolower(str_replace("'", "", $value[title]));
    3. $thread['url'] = ereg_replace("[/?!.$%£()~*@#]+", "", $thread['url']);
    4. $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>";

  2. Edit geek/gars/mods/display/toc.php
    CODE:
    1. $bits.="<li><div class=\"smallfont\"><a href=\"showthread.php?t=$threadinfo[threadid]&amp;garpg=" . ($toc_x + 1). "#content_start\">";
    2. $bits.=$this->navigation['pages'][$toc_x]['text'] ? $this->navigation['pages'][$toc_x]['text'] : construct_phrase($vbphrase['GARS_pagex'],($toc_x + 1));
    3. $bits.="</a></div></li>";

    Replaced with

    CODE:
    1. $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))));
    2. $thread['url'] = ereg_replace("[/?!.$%£()~*@#]+", "", $thread['url']);
    3. $bits.="<li><div class=\"smallfont\"><a href=\"a$threadinfo[threadid]-" . ($toc_x + 1). "-$thread[url].html\">";

  3. Edit the following templates

    GARS_forumbit_level1_nopost
    GARS_forumbit_level1_post
    GARS_forumdisplay
    GARS_simple_threadbit
    GARS_subforumbit_nopost
    GARS_subforumbit_post
    GARS_threadbit

    Replace:

    CODE:
    1. showthread.php?$session[sessionurl]t=$thread[threadid]

    with

    CODE:
    1. t$thread[threadid]-$thread[url].html

VBulletin SEO URL Rewriting

August 19, 2007

  1. Place the code below in the .htaccess.
    CODE:
    1. RewriteRule ^t([0-9]+)-(.*).html$ showthread.php?t=$1 [L]
    2. RewriteRule ^lastpostinthread([0-9]+).html$ showthread.php?goto=lastpost&amp;t=$1 [L]
    3. RewriteRule ^newpostinthread([0-9]+).html$ showthread.php?goto=newpost&amp;t=$1 [L]
    4. RewriteRule ^f([0-9]+)-(.*).html$ forumdisplay.php?forumid=$1 [L]

  2. Edit the functions_forumlist.phpSearch for:
    CODE:
    1. $forum['statusicon'] = fetch_forum_lightbulb($forumid, $lastpostinfo, $forum);

    and below that add

    CODE:
    1. $forum['url'] = strtolower(str_replace(" ", "-",str_replace("/", "-", $forum['title'])));
    2. $forum['url'] = strtolower(str_replace("'", "",str_replace("/", "-", $forum['title'])));

  3. Edit the forumdisplay.php.Search for:
    CODE:
    1. $thread = process_thread_array($thread, $lastread, $foruminfo['allowicons']);

    and below that add

    CODE:
    1. $thread['url'] = strtolower(str_replace(" ", "-", $thread['threadtitle']));
    2. $thread['url'] = strtolower(str_replace("'", "", $thread['threadtitle']));
    3. $thread['url'] = ereg_replace("[/?!.$%£()~*@]+", "", $thread['url']);

  4. Edit the threadbit template.Search for:
    CODE:
    1. <a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]">

    and below that add

    CODE:
    1. </a><a href="t$thread[threadid]-$thread[url].html">

  5. Change the following template:
    Search the following:

    CODE:
    1. </a><a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]">

    Replace with:

    CODE:
    1. </a><a href="$forum[url].html">

    forumhome_forumbit_level1_nopost
    forumhome_forumbit_level1_post
    forumhome_forumbit_level2_nopost
    forumhome_forumbit_level2_post
    forumhome_lastpostby

VBulletin URL Rewriting

August 18, 2007

This discussed how to make the VBulletin URL to a human readable format.

Link

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.

Link

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

An Introduction to AJAX

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

Next Page »