I am using xmlns:trh="http://myfaces.apache.org/trinidad/html";

and also using   xmlns:h="http://java.sun.com/jsf/html"; in my
.jspx page. The html code written is working fine stand alone
in .html file but the same code not working in .jspx file.

Code for that is given below.


<script type="text/javascript">
 
                                        function formatOnKeyPress(element)
{
                                                      var 
value=element.value;
                                                      var limit = new 
Array(6,2);
                                                      var c = 
String.fromCharCode(window.event.keyCode);
                                                          value = 
value.replace(/^\s+/, "").replace(/\s+$/, "" );
                                                      if
(/\d/.test(c)&amp;&amp;(/\./.test(value)?/^.*\.\d?$/.test(value):(!value||value.match(/\d/g).length&lt;6)))
{
                                                            value= 
/^[^\.]*$/.test(value)?/^.*\,?\d{3}$/.test(value)?value+",":value:value;
 element.value=value; 
                                                            return true;
                                                      }else if
(/[\.\,]/.test(c)&amp;&amp;!/\./.test(value)){
                                                            return true;
                                                      }else{
                                                            return false;
                                                      } 
                                                }

</script>

<h:inputText id="txtBalance" maxlength="10"
        value="#{MyBean.adjustBal}"
        styleClass="InputText" onkeypress="return formatOnKeyPress(this);" 
/>


reply as soon as possible.
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you


<<image/gif>>

Reply via email to