Hi,
I am validating form using both vbscript and javascript. I am getting the dynamic input data from web page using vbscript and validating the field with javascript on client-side before i submitting to database. I am facing problem where Javascript doesn't recognize those variables in <%=variable%> since I am getting the input with vbscript. Is there any way that Jscript and vbscript can communicate each other or any help. Here is the my code...
-----------------------------------------------------
Javascript:
function validateCreateForm(formCreate){
var errors
errors = ''
if(document.formCreate.txtGoals_<%=strSCID%>.value == "" || document.formCreate.txtGoals_<%=strSCID%>.value == null) {
errors += '- Please enter the Goals.\n';
}
if(document.formCreate.txtAch_<%=strSCID%>.value == "" || document.formCreate.txtAch_<%=strSCID%>.value == null) {
errors += '- Please enter the Goals.\n';
}
if (errors){
alert('The following error(s) occurred:\n'+errors);
return false;
}
else {
return true;
}
}
-----------------------------------------------------
HTML Code:
<tr bgcolor="#FFEEBB" class="formtext">
<td bgcolor="#FFEEBB" class="trborder"><%=rstScWt("ScoreWeightCode")%> - <%=rstScWt("ScoreWeightDetails")%></td>
<td class="trborder"><textarea name="txtGoals_<%=strSCID%>" cols="35" class="text" rows="4" wrap="virtual"></textarea></td>
<td class="trborder"><textarea name="txtAch_<%=strSCID%>" cols="35" class="text" rows="4" wrap="virtual"></textarea></td>
<td class="trborder"><div align="center"><input name="txtRawScore_<%=strSCID%>" type="text" classs="text" size="4" maxlength="4">
</div></td>
<td class="trborder"><textarea name="txtSCRemarks_<%=strSCID%>" cols="35" class="text" rows="4" wrap="virtual"></textarea></td>
</tr>
-----------------------------------------------------
I am validating form using both vbscript and javascript. I am getting the dynamic input data from web page using vbscript and validating the field with javascript on client-side before i submitting to database. I am facing problem where Javascript doesn't recognize those variables in <%=variable%> since I am getting the input with vbscript. Is there any way that Jscript and vbscript can communicate each other or any help. Here is the my code...
-----------------------------------------------------
Javascript:
function validateCreateForm(formCreate){
var errors
errors = ''
if(document.formCreate.txtGoals_<%=strSCID%>.value == "" || document.formCreate.txtGoals_<%=strSCID%>.value == null) {
errors += '- Please enter the Goals.\n';
}
if(document.formCreate.txtAch_<%=strSCID%>.value == "" || document.formCreate.txtAch_<%=strSCID%>.value == null) {
errors += '- Please enter the Goals.\n';
}
if (errors){
alert('The following error(s) occurred:\n'+errors);
return false;
}
else {
return true;
}
}
-----------------------------------------------------
HTML Code:
<tr bgcolor="#FFEEBB" class="formtext">
<td bgcolor="#FFEEBB" class="trborder"><%=rstScWt("ScoreWeightCode")%> - <%=rstScWt("ScoreWeightDetails")%></td>
<td class="trborder"><textarea name="txtGoals_<%=strSCID%>" cols="35" class="text" rows="4" wrap="virtual"></textarea></td>
<td class="trborder"><textarea name="txtAch_<%=strSCID%>" cols="35" class="text" rows="4" wrap="virtual"></textarea></td>
<td class="trborder"><div align="center"><input name="txtRawScore_<%=strSCID%>" type="text" classs="text" size="4" maxlength="4">
</div></td>
<td class="trborder"><textarea name="txtSCRemarks_<%=strSCID%>" cols="35" class="text" rows="4" wrap="virtual"></textarea></td>
</tr>
-----------------------------------------------------