[
Lists Home |
Date Index |
Thread Index
]
Thanks for you suggestion to the xslt list.
The html on the page does work. It shows me the form, I can work with it,
etc. The only thing
I can not do is in my javascript, I want to walk through all the forms
elements and look for ones
which have a certain class value and then make a check of their value.
function editTab(elClass) {
var form1 = document.forms[0];
var elemClass = elClass;
var all = form1.getElementsByTagName('*');
var elements = new Array();
for (var e = 0; e < all.length; e++){
if (all[e].className == elemClass)
elements[elements.length] = all[e];
}
if(elemClass == "demo") {
document.writeln("<br>elements.length = " + elements.length + "</br>");
document.writeln("<br>elemClass = " + elemClass + "</br>");
document.writeln("<br>all.length = " + all.length + "</br>");
// the rest of this function has not been included
}
}
This script is in an XML file that calls a style sheet containing the html
for the forms elements.
The xml file also contains the form tags. In the above script I can get the
name of the form mainform, but not a list
of the elements. Below is the section of the same xml file that shows the
form section. Below that is a section of the view source from the page that
comes up. I can change values in the form, etc, but it does not let me get
the list of elements to get the ones with a certain classname.
<!--<body OnLoad="placeFocus()">-->
<body onload="init()">
<form name="mainform" METHOD="post"
onSubmit="return doSubmit()"
ACTION="/promed/servlet/promedica.AppDriver?opt=flow.GatherGuarInfo2">
<xsl:call-template name="banner" />
<div id="tabs">
<span id="tab1" class="tab">
<font color="red">(X)</font>
Demographics</span>
<span id="tab2" class="tab">
<font color="red">(X)</font>
Next of Kin</span>
<span id="tab3" class="tab">
<font color="red">(X)</font>
Visit</span>
<span id="tab4" class="tab">
<font color="red">(X)</font>
Guarantor</span>
<span id="tab5" class="tab">
<font color="red">(X)</font>
Insurance</span>
<input type="submit" name="save"
value="Complete Registration" />
</div>
<div id="content1" class="content">
<table width="100" border="0" cellspacing="0"
cellpadding="0">
<xsl:apply-templates
select="/Display/datamap/error" />
<xsl:apply-templates
select="/Display/Demographics" />
</table>
</div>
<div id="content2" class="content">
<table width="100" border="0" cellspacing="0"
cellpadding="0">
<xsl:apply-templates select="/Display/Next_of_kin" />
</table>
</div>
<div id="content3" class="content">
<table width="100" border="0" cellspacing="0"
cellpadding="0">
<xsl:apply-templates select="/Display/Visit" />
</table>
</div>
<div id="content4" class="content">
<table width="550" border="0" cellspacing="0"
cellpadding="0">
<xsl:variable name="gtype"
select="/Display/datamap/guarSelect" />
<xsl:choose>
<xsl:when test="$gtype='1'">
<xsl:apply-templates
select="/Display/GuarantorSelf" />
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates
select="/Display/Guarantor" />
</xsl:otherwise>
</xsl:choose>
</table>
</div>
<div id="content5" class="content">
<table width="550" border="0" cellspacing="0"
cellpadding="0">
<!-- Content -->
<xsl:variable name="itype"
select="/Display/datamap/InsuranceType" />
<xsl:choose>
<xsl:when test="$itype='blue'">
<xsl:apply-templates
select="/Display/InsuranceBlue" />
</xsl:when>
<xsl:when test="$itype='comm'">
<xsl:apply-templates
select="/Display/InsuranceComm" />
</xsl:when>
<xsl:when test="$itype='care'">
<xsl:apply-templates
select="/Display/InsuranceCare" />
</xsl:when>
<xsl:when test="$itype='self'">
<xsl:apply-templates
select="/Display/InsuranceSelf" />
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates
select="/Display/InsuranceHMO" />
</xsl:otherwise>
</xsl:choose>
</table>
</div>
</form>
<!--xsl:call-template name="footer"/-->
</body>
<?xml version="1.0"?>
<?xml:stylesheet type="text/xsl"
href="http://promed/xsl/3MMPIDisplayTabsJun.xsl"?>
<Display>
<Demographics>
<TR>
<TD valign="top" width="100%" colspan="3">
<TABLE cellpadding="6" cellspacing="0" border="0">
<TBODY>
<TR>
<TD>
<H1 id="largesans">MPI Information</H1>
<TABLE border="2" bgcolor="lightblue">
<TBODY>
<TR>
<TD bgcolor="yellow">Selected</TD>
<TD bgcolor="yellow" id="sanspre"><span
source="Patient_Last_Name"/>, <span source="Patient_First_Name"/> <span
source="Patient_Initial"/> Unit #:<span source="UnitNum"/> MRN:<span
source="toMRN"/></TD>
</TR>
<TR>
<TD title="Patient Name">Name</TD>
<TD>
<TABLE border="1" bordercolor="lightblue">
<TR>
<TD><INPUT class="demo" type="text"
id="Patient_First_Name" name="Patient_First_Name" size="24" title="Patient
First Name" maxlength="24" source="Patient_First_Name" edit="c(rq)"
onChange="checkIt('Demographics')"/></TD>
<TD><INPUT class="demo"
type="text" name="Patient_Initial" size="24" title="Patient Middle Initial"
maxlength="24" source="Patient_Initial"/></TD>
<TD><INPUT class="demo" type="text"
name="Patient_Last_Name" size="24" title="Patient Last Name" maxlength="24"
source="Patient_Last_Name" edit="c(rq)"
onChange="checkIt('Demographics')"/></TD>
</TR>
</TABLE>
</TD>
</TR>
<TR>
<TD title="Patient Sex">Sex</TD>
<TD>
<TABLE border="1" bordercolor="lightblue">
<TR>
<TD><select class="demo"
name="Sex" source="Sex" edit="c(rq)"
onChange="checkIt('Demographics')"/></TD>
<TD>DOB<INPUT class="demo"
type="text" name="Patient_DOB" source="Patient_DOB" size="10" title="Patient
Date of Birth" edit="c(rq)dt(ccyymmdd)"
onChange="checkIt('Demographics')"/></TD>
<TD>SSN<INPUT class="demo"
type="text" name="SSN" source="SSN" size="11" title="Patient Social Security
Number" maxlength="11" edit="c(nr)f(NNN-NN-NNNN)"/></TD>
</TR>
</TABLE>
</TD>
</TR>
<TR>
<TD title="Patient Address Line 1">Address</TD>
<TD><INPUT class="demo" type="text"
name="Street1" source="Street1" size="31" title="Patient Address Line 1"
maxlength="31"/>
<INPUT class="demo" type="text" name="Street2"
source="Street2" size="31" title="Patient Address Line 2"
maxlength="31"/></TD>
</TR>
<TR>
<TD></TD>
<TD><INPUT class="demo" type="text" name="City"
source="City" size="30" title="City" maxlength="30"/>
<select class="demo" source="States"
name="State"/>
<INPUT class="demo" type="text"
name="PostCode" source="PostCode" size="10" title="Zip" maxlength="10"/>
</TD>
</TR>
<TR>
<TD title="Country">Country</TD>
<TD>Country<select class="demo" source="Country"
name="Country" title="Country"/></TD>
</TR>
<TR>
<TD title="Home Phone">Home</TD>
<TD>
<TABLE border="1" bordercolor="lightblue">
<TR>
<TD><INPUT class="demo" type="text"
name="Local_Area_Code" source="Local_Area_Code" size="3" title="Home Area
Code" maxlength="3" edit="c(nr)f(NNN)"/></TD>
<TD><INPUT class="demo" type="text"
name="Local_Number" source="Local_Number" size="8" title="Home Phone"
maxlength="8" edit="c(nr)f(NNN-NNNN)"/></TD>
<TD>Work<INPUT class="demo"
type="text" name="Work_Area_Code" source="Work_Area_Code" size="3"
title="Work Area Code" maxlength="3" edit="c(nr)f(NNN)"/></TD>
<TD><INPUT class="demo" type="text"
name="Work_Number" source="Work_Number" size="8" title="Work Phone"
maxlength="8" edit="c(nr)f(NNN-NNNN)"/></TD>
</TR>
</TABLE>
</TD>
</TR>
<TR>
<TD title="Race">Race</TD>
<TD><select class="demo" source="Race"
name="RaceCid"/>
Marital Status<select class="demo"
source="MaritalStatus" name="Patient_Marital_Status"/></TD>
</TR>
<TR>
<TD title="Religion">Religion</TD>
<TD><select class="demo" source="Religion"
name="Patient_Religion"/></TD>
</TR>
<TR>
<TD title="Mother's Maiden Name">Maiden
Name</TD>
<TD><INPUT class="demo" type="text"
name="PatientLastNamePrev" source="PatientLastNamePrev" size="24"
title="Mother's Maiden Name" maxlength="24"/></TD>
</TR>
</TBODY>
</TABLE>
<H1 id="largesans">Employer Information</H1>
<TABLE border="2" bgcolor="lightblue">
<TBODY>
<TR>
<TD title="Employer">Employer</TD>
<TD><INPUT class="demo" type="text"
name="Employer" source="Employer" size="24" title="Employer"
maxlength="24"/>
Occupation<INPUT class="demo"
type="text" name="Occupation" source="Occupation" size="30"
title="Occupation" maxlength="30"/></TD>
</TR>
<TR>
<TD title="Employer Address Line 1">Address</TD>
<TD><INPUT class="demo" type="text"
name="Employer_Address1" source="Employer_Address1" size="31"
title="Employer Address Line 1" maxlength="31"/></TD>
</TR>
<TR>
<TD></TD>
<TD><INPUT class="demo" type="text"
name="Employer_City" source="Employer_City" size="30" title="Employer City"
maxlength="30"/>
<select class="demo" source="States"
name="Employer_State" title="Employer State"/>
<INPUT class="demo" type="text"
name="Employer_Zip" source="Employer_Zip" size="10" title="Employer Zip"
maxlength="10"/></TD>
</TR>
<TR>
<TD title="Employment Status">Employment
Status</TD>
<TD><select class="demo"
source="EmploymentStatus" name="Employment_Status"/>
ID<INPUT class="demo" type="text"
name="Employee_ID" source="Employee_ID" size="10" title="Employee ID"
maxlength="10"/>
</TD>
</TR>
</TBODY>
</TABLE>
</TD>
</TR>
</TBODY>
</TABLE>
</TD>
</TR>
</Demographics>
Any ideas?
Thanks in advance
Dean-O
|