Hi,
Can anybody here help me out of this:
<%
String mask = "11111";
%>
<script language="javascript">
re = /^(0|1){5}/;
alert("a <%=mask%>");
if(!re.test(<%=mask%>))
{
<%mask="11111"%>;
}
alert("b <%=mask%>");
</script>
But it seems that the jsp code <%mask="11111"%> will be excuted no mater the if-statement is true or not.
Can the code be writen like that, or if there are some other tricks I need to play around to let it work?
Your help will be highly appreciated.
Thanks!
Can anybody here help me out of this:
<%
String mask = "11111";
%>
<script language="javascript">
re = /^(0|1){5}/;
alert("a <%=mask%>");
if(!re.test(<%=mask%>))
{
<%mask="11111"%>;
}
alert("b <%=mask%>");
</script>
But it seems that the jsp code <%mask="11111"%> will be excuted no mater the if-statement is true or not.
Can the code be writen like that, or if there are some other tricks I need to play around to let it work?
Your help will be highly appreciated.
Thanks!