I have the below xsl:
<xsl:template match="attribute[controlType='TextBox']">
<input style="width:180pt" type="input" value="">
<xsl:attribute name="id">fldCsXML_<xsl:value-of select="name"/></xsl:attribute>
<xsl:attribute name="name">fldCsXML_<xsl:value-of select="name"/></xsl:attribute>
<xsl:attribute name="value"><xsl:value-of select="data"/></xsl:attribute>
</input>
</xsl:template>
I want to do javascript validation on the value part to not allow symbols. Just to allow numbers or letters.
Maybe with jquery similar to :
try bellow script this will not allow special charter # $ % ^ & * ( )
function validate() {
var element = document.getElementById('input-field');
element.value = element.value.replace(/[^a-zA-Z0-9@]+/, '');
};
<input type="text" id="input-field" onkeyup="validate();"/>
Any help in changing the xsl above in the easiest possible way and adding jquery / javascript validation is appreciated
So you could do something like this:
Given input document ...
... applying XSLT 2.0 stylesheet ...
... will yield output ...