Ultimate Web Site Drop Down Menu Forum

Ultimate Web Site Drop Down Menu Forum (http://www.udm4.com/forum/index.php)
-   Javascript (http://www.udm4.com/forum/forumdisplay.php?f=9)
-   -   No focus on page, when page loads (http://www.udm4.com/forum/showthread.php?t=974)

ISMAILC 02-29-2008 06:11 AM

No focus on page, when page loads
 
Hi, i'm using an xslt file that loads my page - which does not use a body.

The problem i have is that everytime i open the page the focus is on the submit button. I don't really want that - where i just want no focus when the page opens up. I geuss a javascript is needed but i also dont have a body tag!

Any ideas!

Please assist!

Regards

02-29-2008 02:02 PM

Can you post the output / HTML of the page? Is there an onload handler that's setting focus to that submit button?

ISMAILC 03-03-2008 06:45 AM

Thanks - i don't have a body to do an onload
 
Thanks - i don't have a body to do an onload

[code]
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:asp="remove" xmlns:igchart="remove" xmlns:igsch="remove">
<xsl:output omit-xml-declaration = "yes" />
<xsl:template match="/">
<table width="100%" class="tbDetail">
<!-- Tracking stuff -->
<tr>
<td>
<SCRIPT TYPE='text/javascript'>
function hideHist()
{
if (typeof fcHist != 'undefined')
{
fcHist.style.display = 'none';
}
}
</SCRIPT>
<!--
<link rel="stylesheet" type="text/css" href="balloontip.css" />

<script type="text/javascript" src="balloontip.js">
</script>
-->

<script TYPE='text/javascript' src="./codebase/dhtmlxcommon.js"></script>
<script TYPE='text/javascript' src="./codebase/dhtmlxcombo.js"></script>
<link rel="STYLESHEET" type="text/css" href="./codebase/dhtmlxcombo.css"></link>

<script TYPE='text/javascript'>
window.dhx_globalImgPath="./codebase/imgs/";
</script>
</td>
</tr>
<xsl:variable name="cHist" select="count(Activity/myTracking/Activity[ DateResolved != '0' ])" />
<xsl:if test="$cHist &gt; '0'">
<tr width="100%">
<td colspan="6" class="row1">
<SCRIPT TYPE='text/javascript'>
function toggleHist(srcElement, srcArrow) {
if (srcElement.style.display == 'none')
{
srcElement.style.display = '';
srcArrow.src = 'images/expand.gif';
} else
{
srcElement.style.display = 'none';
srcArrow.src = 'images/collapse.gif';
}
}
</SCRIPT>
<span id='fcHistMain' style='cursor:hand;' onclick='toggleHist(fcHist, fcExpand)'>
<span style="vertical-align:middle;">
<img src='images/collapse.gif' id='fcExpand' align="middle" /> Expand to view the History
</span>
</span>
</td>
</tr>
<tr>
<td colspan="6">
<div id='fcHist'>
<table width='100%' class='tbList'>
<xsl:for-each select="Activity/myTracking/Activity[ DateResolved != '0' ]">
<xsl:sort select='@id' />
<tr>
<td width='5%'><xsl:attribute name='class'><xsl:if test="position() mod 2 = 1">on</xsl:if><xsl:if test="position() mod 2 != 1">off</xsl:if></xsl:attribute><xsl:value-of select="position()" />. </td>
<td width='55%'><xsl:attribute name='class'><xsl:if test="position() mod 2 = 1">on</xsl:if><xsl:if test="position() mod 2 != 1">off</xsl:if></xsl:attribute>
<xsl:if test="TrackValues = 'False'">
<xsl:value-of select="Description" />
</xsl:if>
<xsl:if test="TrackValues = 'True' or TrackValues = ''">
<a>
<xsl:attribute name='href'>myTrackingPage.aspx?type=a&amp;id=<xsl :value-of select="@id" /></xsl:attribute>
<xsl:attribute name='class'>bn</xsl:attribute>
<xsl:value-of select="Description" />
</a>
</xsl:if>
</td>
<td width='20%'><xsl:attribute name='class'><xsl:if test="position() mod 2 = 1">on</xsl:if><xsl:if test="position() mod 2 != 1">off</xsl:if></xsl:attribute>
<xsl:if test="CreatorEMail[. = '']"><xsl:value-of select="Creator" /></xsl:if>
<xsl:if test="CreatorEMail[. != '']">
<a>
<xsl:attribute name='class'>bn</xsl:attribute>
<xsl:attribute name='href'>mailto:<xsl:value-of select="CreatorEMail" />?Subject=<xsl:value-of select="Description" /></xsl:attribute>
<xsl:value-of select="Creator" />
</a>
</xsl:if>
</td>
<td width='20%'>
<xsl:attribute name='class'><xsl:if test="position() mod 2 = 1">on</xsl:if><xsl:if test="position() mod 2 != 1">off</xsl:if></xsl:attribute>
<xsl:value-of select="substring(DateResolved,1,4)"/>/<xsl:value-of select="substring(DateResolved,5,2)"/>/<xsl:value-of select="substring(DateResolved,7,2)" /> 
<xsl:value-of select="substring(TimeResolved,1,2)" />:<xsl:value-of select="substring(TimeResolved,3,2)" />:<xsl:value-of select="substring(TimeResolved,5,2)" />
</td>
</tr>
</xsl:for-each>
</table>
</div>
</td>
</tr>
</xsl:if>

ISMAILC 03-03-2008 07:14 AM

Great!!! - I got it going!
 
Hi, Thank You very much for all the help!!!

What i did was add the following attribute to my submit button where the focus was on!

<xsl:attribute name="onfocus">this.blur(); this.onfocus=null;</xsl:attribute>

This work's fantastically well!


Thank You very much!!!


All times are GMT. The time now is 10:47 PM.

Powered by vBulletin® Version 3.0.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.