473,405 Members | 2,167 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

xsl validation problem

hi this is rahul here

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
  1. <table width="327" border="0" class="ordinary_text">
  2.                                   <tr>
  3.                                     <td width="64">Number : </td>
  4.                                     <td width="146">
  5.                                         <input type="text" name="cardno" size="23" maxlength="6" onkeyup="cardChangeValidation()">
  6.                                             <xsl:attribute name="value"><xsl:value-of select="@cardno"/></xsl:attribute>
  7.                                         </input>
  8.                                     </td>
  9.                                     <td width="95" rowspan="2">
  10.                                         <input type="submit" value="Change" onclick="document.all['myForm'+this.name.substring(4)].actionType.value='card';">
  11.                                             <xsl:attribute name="name">subC<xsl:value-of select="@childId"/></xsl:attribute>
  12.                                         </input>
  13.                                     </td>
  14.                                   </tr>
  15.                                   <tr>
  16.                                     <td>Balance : </td>
  17.                                     <td>
  18.                                         <input type="text" name="balance" size="23" disabled="disable">
  19.                                             <xsl:attribute name="value"><xsl:value-of select="@balance"/></xsl:attribute>
  20.                                         </input>
  21.                                     </td>
  22.                                   </tr>
  23.                                 </table>
  24.  
----------------------------------
cardChangeValidation() method in javascript


Expand|Select|Wrap|Line Numbers
  1. function cardChangeValidation()
  2. {
  3.     var cardNo=document.forChangeCard].cardno.value;
  4.  
  5.     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
  6. }
Jun 6 '07 #1
12 2367
dorinbogdan
839 Expert 512MB
I will move the thread from Articles section to Forum section.
Please do not post in Articles section.

Thanks,
Dorin.
Jun 6 '07 #2
sorry and thanks for posting it to forums
Jun 6 '07 #3
dorinbogdan
839 Expert 512MB
Try to use id instead of name attribute for input textboxes:
<input type="text" id="cardno"....
<input type="text" id="balance"...

then in javascript update:
var cardNo=document.getElementById("cardno").value;
Jun 6 '07 #4
Try to use id instead of name attribute for input textboxes:
<input type="text" id="cardno"....
<input type="text" id="balance"...

then in javascript update:
var cardNo=document.getElementById("cardno").value;

the code u have given is giving me the value...........thanks

but i am not getting the perfect data. i will tell more clearly.........

in the student page left hand side i am displaying the data of 10 student.....
lastname first name cardno balance
r rr g 0005 56
ttt hhh 006 77
.................................................. ............
.................................................. ............

so when i will select one of the field from this then on the right hand side it will display cardno & balance textbox with the data 006 and 77.......
so the above code which u have given is giving me the value but for the 1 field that is 0005 & 56......
but i wnt the data which i have selected.................


please tell me .................
Jun 6 '07 #5
dorinbogdan
839 Expert 512MB
Please post the HTML result as it is currently, that is the source code behind the web page.
Jun 6 '07 #6
Please post the HTML result as it is currently, that is the source code behind the web page.
----------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="AdminAccounts.xsl"?><user type="Admin" firstName="Admin" lastName="User">

<year y="" firstYear="" secondYear="">
</year>
<child cardno="000050" first="Aswin" last="Kumar" balance="0.0" childId="2">

<parent email="sdfwer@SDF.com" first="wewrwe" last="werew" lastlogin="null" parentId="5" prefLan="CZ" /></child><child cardno="000001" first="Anbu" last="Selvan" balance="0.0" childId="1">

<parent email="chenthil@gmail.com" first="Chenthil" last="Velan" lastlogin="2007-06-05 13:22:07.843" parentId="2" prefLan="CZ" /></child><child cardno="000003" first="Paruthi" last="Veeran" balance="0.0" childId="3">

</child><child cardno="000345" first="rrrr" last="gggg" balance="0.0" childId="6">

</child><child cardno="043534" first="ffff" last="gggg" balance="0.0" childId="9">

</child><child cardno="045645" first="oooo" last="pppp" balance="0.0" childId="11">

</child><child cardno="000004" first="asdf" last="qwer" balance="0.0" childId="4">

</child><child cardno="000676" first="gggg" last="rrrr" balance="0.0" childId="10">

</child><child cardno="000235" first="tttt" last="uuuu" balance="0.0" childId="7">

</child><child cardno="000016" first="qqqw" last="www" balance="0.0" childId="5">

</child><child cardno="035443" first="www" last="xxxx" balance="0.0" childId="8">

</child></user>
Jun 6 '07 #7
dorinbogdan
839 Expert 512MB
This is the XSL code, but I'd like to see the HTML output, as appears when right-click on page and "View page source".
Jun 6 '07 #8
This is the XSL code, but I'd like to see the HTML output, as appears when right-click on page and "View page source".
---------------------------------------------------------
when i am clicking for the view source it is giving alert...
xml source file is unavilable for viewing......
Jun 6 '07 #9
---------------------------------------------------------
when i am clicking for the view source it is giving alert...
xml source file is unavilable for viewing......



how can i attach file if i want to attach any.............
.......
Jun 6 '07 #10
i want to send u screen shot so that u can get clear picture how to send ..............
Jun 6 '07 #11
dorinbogdan
839 Expert 512MB
Ok, no problem.

I think that the bug is caused because more input textboxes have the same id "cardno". They should be something like cardno1, cardno2, cardno3...
You should set an index for each child (table row).
And then based on it to set the id="cardno" + index for each input.
Jun 6 '07 #12
hi this is rahul here

1 problem......
in xsl file, under script tag i have defined 1 global variable and that variable i want outside the script---------

<td>Balance : </td>
<td><input type="text" name="balance" size="23" onclick="checkCardNo()">
<xsl:attribute name="value"><xsl:value-of select="@balance"/></xsl:attribute>
</input>
</td>

so before this lines of coding i want to check that global variable that if it is equal this then the input type balance is disable otherwise enable..........
so what i want is before displaying this text box i need to check that variable which i have defined under <script> tag.


please do teel me.............................
Jun 7 '07 #13

Sign in to post your reply or Sign up for a free account.

Similar topics

21
by: Stefan Richter | last post by:
Hi, after coding for days on stupid form validations - Like: strings (min / max length), numbers(min / max value), money(min / max value), postcodes(min / max value), telefon numbers, email...
41
by: Gérard Talbot | last post by:
Cross-posted to: comp.infosystems.www.authoring.html and alt.html Followup-to: comp.infosystems.www.authoring.html 1- One day, I stumbled across a website that offers to validate webpages. What...
3
by: Kent Ogletree | last post by:
I am porting a Java XML Validation class over to C# and I am having a problem finding exactly what I need to acomplish the task. First I need to test for well formedness. I know this is usually...
4
by: | last post by:
Hello Guys, I am using the validation controls to validate my data. But the problem is "The page is still being posted to server". I want to get rid of the round trips to server. Are there...
4
by: usl2222 | last post by:
Hi folks, I appreciate any assistance in the following problem: I have a form with a bunch of dynamic controls on it. All the controls are dynamically generated on a server, including all...
3
by: john morales | last post by:
Hi guys, I have a problem and i know there must be a solution for this as it is such a basic common practice in asp.net development. Scenario: i have many webforms in a site, most with two...
5
by: Chris | last post by:
Based upon some prevoius postings on what to do for adding a 'add' row to a datagrid I utilize the footer to create the 'add' row. The only issue is that I have it sharing the 'UpDate_Command' and...
4
by: David Colliver | last post by:
Hi all, I am having a slight problem that hopefully, someone can help me fix. I have a form on a page. Many items on the form have validation controls attached. Also on this form are...
9
by: Bill Long | last post by:
I have a control that simply displays a list of links. Following one of the links doesn't post back or redirect to another page, it simply hides the current panel and shows the one you selected......
2
by: dustbort | last post by:
I recently had a problem where my required field validator stopped working. But, the page still posted back and tried to insert a record into the database without performing server-side validation....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.