i am stucked in 1 problem..........
i have 2 input box and in my xsl file .1st will display the card no. of student and the second will display the amount in his balance field.this data i am retreving from my xml file.
now what i want is to edit the card no. and amount field but ,there is 1validation that if the student is changing its card no. then only the balance field should be enable otherwise disable .
that is if the card no is changed then only he should be able to change balance field.
what i am doing is retriving the original value cardno. in java script and check with the no entered in text box if the no is changed then the balance field is enabled.
and this method is called onkeyup event.
so please do let me know ur thoughts ..................
here is the sample code.........
(this is xsl file)
Expand|Select|Wrap|Line Numbers
- <table width="327" border="0" class="ordinary_text">
- <tr>
- <td width="64">Number : </td>
- <td width="146">
- <input type="text" name="cardno" size="23" maxlength="6" onkeyup="cardChangeValidation()">
- <xsl:attribute name="value"><xsl:value-of select="@cardno"/></xsl:attribute>
- </input>
- </td>
- <td width="95" rowspan="2">
- <input type="submit" value="Change" onclick="document.all['myForm'+this.name.substring(4)].actionType.value='card';">
- <xsl:attribute name="name">subC<xsl:value-of select="@childId"/></xsl:attribute>
- </input>
- </td>
- </tr>
- <tr>
- <td>Balance : </td>
- <td>
- <input type="text" name="balance" size="23" disabled="disable">
- <xsl:attribute name="value"><xsl:value-of select="@balance"/></xsl:attribute>
- </input>
- </td>
- </tr>
- </table>
cardChangeValidation() method in javascript
Expand|Select|Wrap|Line Numbers
- function cardChangeValidation()
- {
- var cardNo=document.forChangeCard].cardno.value;
- alert(cardNo) ///i am not getting the card value here......i want the database value here so that i can compare with the the value enterd in text box
- }