Button in XSL
<script language="javascript">
var str = "";
<xsl:for-each select="helpLine"> str+="<xsl:value-of select="@label"/>";
str+="<br/>";
</xsl:for-each>
var strLien = '<a href="#" onClick="JavaScript:openHelpWindow(str)"><img src="/dsmapp/config/images/help.gif" border="0"/></a>';
document.write(strLien);
</script>
it create a link with an image (help.gif) to cell openHelpWindow which call a little window which contains strLien (a text).
I would like replace this image with a button, but my button isn't a simple button, I must respect a form.
I've tried to do this :
<script language="javascript">
var str = "";
<xsl:for-each select="helpLine"> str+="<xsl:value-of select="@label"/>";
str+="<br/>";
</xsl:for-each>
var strLien = insertButton(str);
document.write(strLien);
</script>
with the function insertButton :
function insertButton(strHelp)
{
var strBtnBuild="";
var strLien="";
strBtnBuild += '<table border="0" cellspacing="0" cellpadding="0" class="buttonBg">';
strBtnBuild += '<tr>';
strBtnBuild += '<td colspan="4" height="1"><img src="/dsmapp/config/images/spacer.gif" width="1" height="1" /></td>';
strBtnBuild += '</tr>';
strBtnBuild += '<tr>';
strBtnBuild += '<td rowspan="2" width="1"><img src="/dsmapp/config/images/spacer.gif" width="1" height="1" /></td>';
strBtnBuild += '<td class="panel" colspan="2"><img src="/dsmapp/config/images/spacer.gif" width="1" height="1" /></td>';
strBtnBuild += '<td rowspan="2" width="1"><img src="/dsmapp/config/images/spacer.gif" width="1" height="1" /></td>';
strBtnBuild += '</tr>';
strBtnBuild += '<tr>';
strBtnBuild += '<td class="panel" width="1"><img src="/dsmapp/config/images/spacer.gif" width="1" height="1" /></td>';
strBtnBuild += '<td class="button" align="center" valign="middle">';
strBtnBuild += '<table border="0" cellspacing="0" cellpadding="0">';
strBtnBuild += '<tr align="right" valign="middle">';
strBtnBuild += '<td width="5"><img src="/dsmapp/config/images/spacer.gif" width="5" height="5" /></td>';
strBtnBuild += '<td align="center"><a href="#" onClick="JavaScript:openHelpWindow(str)"><span class="button"><xsl:value-of select="/modelInfo/labelList/sLabelHelp"/></span></a></td>';
strBtnBuild += '<td width="5"><img src="/dsmapp/config/images/spacer.gif" width="5" height="5" /></td>';
strBtnBuild += '</tr>';
strBtnBuild += '</table>';
strBtnBuild += '</td>';
strBtnBuild += '</tr>';
strBtnBuild += '<tr>';
strBtnBuild += '<td colspan="4" height="1"><img src="/dsmapp/config/images/spacer.gif" width="1" height="1" /></td>';
strBtnBuild += '</tr>';
strBtnBuild += '</table>';
document.write(strBtnBuild);
strLien = '<a href="#" onClick="JavaScript:openHelpWindow(str)"></a>';
return strLien;
}
I know that it is a little complicated but the button is well construct BUT between the button and the text, there is a new line (a jump of line, I dont' know if that is said like that
:blush: ) the button is in a ligne and the text is a new line lower.
before it was on the same line.
WHY this line exist ?
HELP me please, I begin in web techno ...
;)

