javascript - jQuery form validation issue, other box when visible -



javascript - jQuery form validation issue, other box when visible -

i have below 'other' box. want validate box not blank when visible. should straightforward having trouble. help much appreciated. thanks

else if($('#mybox_' + id + ':visible')) { if(!blank('otherprodtypebox[<xsl:value-of select="@id"/>]')){alert("please come in valid other option");return false;} } <script type="text/javascript"> function myotherbox(e, id) { if (e.value == 'otherprodtype') { $('#mybox_' + id).show(); } else { $('#mybox_' + id).hide(); } } </script> <tr style="display:none;"> <xsl:attribute name="id">mybox_<xsl:value-of select="@id"/></xsl:attribute> <td class="label">other</td> <td> <input class="amdinputtext" type="text" id="otherprodtypebox" value=""> <xsl:attribute name="value"><xsl:value-of select="otherprodtypebox"></xsl:value-of></xsl:attribute> </input> </td> </tr>

edit:

i have working now:

else if($('#mybox_<xsl:value-of select="@id"/>').is(':visible')) { if(!blank('otherprodtypebox[<xsl:value-of select="@id"/>]')){alert("please come in valid other option");return false;} }

ok seems check validation when box visible , throws alert if empty unusual reason when fill in box doesn't throw alert expected wont allow me proceed , no error messages

replacing $('#mybox_' + id + ':visible') $('#mybox_' + id).is(':visible') fixes problem

javascript jquery validation

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -