Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getElementById is returning undefined 1

Status
Not open for further replies.

LyndonOHRC

Programmer
Sep 8, 2005
603
US
In the function putPayeeSSN, the line "if (sel.options[sel.selectedIndex].value.length)", returns undefined in every browser except IE with compatibility view turned on. I'm sure my coding style is too old, but don't do it much anymore.

The putPayeeSSN function populates the tag with id=W9Data#'s innerHTML with data the usewr can review and then enables the "post" button. The post button pushes a database insert using ajax, so that my may not work either, the Ajax does work fine in IE too.

Advice welcome!
Thanks Lyndon

Code:
<!DOCTYPE html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>Charted Claims</title>
	<style>
		table {
		    border-collapse: collapse;
			border: 1px solid black;
		}
		
		a {
			text-decoration: underline;
		}
		
		body {
			text-align: left;
		    padding: 3px;
			font-family: sans-serif; 
			color: black; 
			font-weight: normal;
		}
		
		th {text-align: left; border-bottom: 1px solid black;}
		.odd {
			background-color: #ccffff;
		}
		.even {
			background-color: White;
		}
		
		tr {
			vertical-align: top;
		}
		.plain {
			color: black;
			
		}
		
		tr[id^="W9Data"] td {
 			border-bottom: 1px solid black;
		} 

</style>
<script>
	function putPayeeSSN(elem,row) {
		var sel=document.getElementById(elem)
		if (sel.options[sel.selectedIndex].value.length){
			document.getElementById('Display'+elem).innerHTML='W9 Date: '+sel.options[sel.selectedIndex].w9date;
			document.getElementById('W9Hold'+row).checked=false;
			document.getElementById('ClaimsAddress'+row).innerHTML=sel.options[sel.selectedIndex].AdressBlock;
			document.getElementById('Submit'+row).disabled=false;
		} else {
			document.getElementById('Display'+elem).innerHTML='';
			document.getElementById('W9Hold'+row).checked=true;
			document.getElementById('ClaimsAddress'+row).innerHTML='';
			document.getElementById('Submit'+row).disabled=true;
			
		} return true;
	}
	function postRow(tableRow,RegID,typeOfHorse){
		var xmlhttp;
		var W9='S';
		if (document.getElementById('W9Hold'+tableRow).checked==true){
			W9='N';
		}
		
		var ssnExt=document.getElementById(typeOfHorse+'SSNExt'+tableRow).options[document.getElementById(typeOfHorse+'SSNExt'+tableRow).selectedIndex].ssnExt;
		
		var Hold=0;
		if (document.getElementById('DrugHold'+tableRow).checked==true){
			 Hold=1;
		}
		
		var MiscHold='No';
		if (document.getElementById('MiscHold'+tableRow).checked==true){
			MiscHold='Yes';
		}
		
		var MiscHoldComments=document.getElementById('MiscHoldComments'+tableRow).value;
		
		if (window.XMLHttpRequest)
		  {
		  // code for IE7+, Firefox, Chrome, Opera, Safari
		  xmlhttp=new XMLHttpRequest();
		  }
		else if (window.ActiveXObject)
		  {
		  // code for IE6, IE5
		  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		else
		  {
		  alert("Your browser does not support XMLHTTP!");
		  }
		document.getElementById('Loading'+tableRow).style.display='inline';
		xmlhttp.onreadystatechange=function()
		{
		if(xmlhttp.readyState==4)
		  {
			
			document.getElementById('RegData'+tableRow).style.display='none';
			document.getElementById('PayeeData'+tableRow).style.display='none';
			document.getElementById('HoldData'+tableRow).style.display='none';
			document.getElementById('w9date'+tableRow).style.display='none';
		  }
		}
		
		xmlhttp.open("GET","PutData.cfm?RegID="+RegID+"&typeOfHorse="+typeOfHorse+"&W9="+W9+"&ssnExt="+ssnExt+"&Hold="+Hold+"&MiscHold="+MiscHold+"&MiscHoldComments="+MiscHoldComments);
		xmlhttp.send(null);
	}
</script>
</head>
<html>
<body>
<br />

<div align="center">
	Chart Races
	
	<table>
		<tr>
			<th>
				&nbsp;
			</th>
			<th>
				Payee
			</th>
			<th>
				Race
			</th>
			<th style="text-align:right;">
				Amount
			</th>
		</tr>
		<tbody>
		
					<tr id="RegData1" class="odd">
						<td style="text-align: right;">
							1.
						</td>
						<td>
							
								<a href="IRSLookup.cfm?id=xxx-xx-xxxx" 
									target="_blank">
									xxx-xx-xxxx
								</a>
							JAMES & WENDY HOWARD
						</td>
						<td>
							RPM2018030901&nbsp;&nbsp;&nbsp Win 
						</td>
						<td style="text-align: right;">
							$510.00
						</td>
					</tr>
					<tr id="PayeeData1" class="odd">
						<td>
							&nbsp;
						</td>
						<td>
							PO BOX 100<br />
							WAYNE OK 73095
						</td>
						<td colspan="2">
							GIRLS GOT GRIP - Dam
						</td>
					</tr>
					<tr id="HoldData1" class="odd">
						<td colspan="2">
							
								<select name="DMWinSSNExt1" id="DMWinSSNExt1" onchange="putPayeeSSN(this.id,1)">
									<option value="" w9date="">Select Payee</option>
									
										<option 
											w9date="09/25/2014" 
											value="xxx-xx-xxxx-A"
											ssnExt="A"
											AdressBlock="PO BOX 100<br />WAYNE OK 73095"
											Style="background-color: White;">
											xxx-xx-xxxx-A) JAMES HOWARD
										</option>
									
										<option 
											w9date="07/20/2014" 
											value="xxx-xx-xxxx-B"
											ssnExt="B"
											AdressBlock="PO BOX 100<br />C/O JAMES HOWARD<br />WAYNE OK 73095"
											Style="background-color: White;">
											xxx-xx-xxxx-B) JAMES HOWARD / WENDY HOWARD
										</option>
									
										<option 
											w9date="07/20/2014" 
											value="xxx-xx-xxxx-C"
											ssnExt="C"
											AdressBlock="PO BOX 100<br />C/O JAMES HOWARD<br />WAYNE OK 73095"
											Style="background-color: White;">
											xxx-xx-xxxx-C) JAMES HOWARD / WENDY HOWARD (LESSEE)
										</option>
									
								</select>
							
						</td>
						<td colspan="2">
							Holds: 	W9<input type="CheckBox" name="W9Hold1" id="W9Hold1">
									Drug<input type="CheckBox" name="DrugHold1" id="DrugHold1">
									Misc<input type="CheckBox" name="MiscHold1" id="MiscHold1">
							<input type="text" name="MiscHoldComments1" id="MiscHoldComments1" size="25" maxlength="254">
							<img id="Loading1" src="..\includes\ajax-loading-gif-7.gif" height="25" width="25" style="display: none;" />
							&nbsp;<button name="Submit1" id="Submit1" onclick="postRow(1,12470,'DMWin')" disabled>Post</button>
						</td>
					</tr>
					<tr id="w9date1" class="odd">
						<td style="border-bottom: 1px solid black;">
							&nbsp;
						</td>
						<td id="ClaimsAddress1" style="border-bottom: 1px solid black;">
							
						</td>
						<td colspan="2" id="DisplayDMWinSSNExt1" style="border-bottom: 1px solid black;">
							
						</td>
					</tr>
				
					<tr id="RegData2" class="even">
						<td style="text-align: right;">
							2.
						</td>
						<td>
							
								<a href="IRSLookup.cfm?id=xxx-xx-xxxx" 
									target="_blank">
									xxx-xx-xxxx
								</a>
							JEFF ADAMS and JOHN DIEDIKER
						</td>
						<td>
							RPM2018030901&nbsp;&nbsp;&nbsp Place 
						</td>
						<td style="text-align: right;">
							$450.00
						</td>
					</tr>
					<tr id="PayeeData2" class="even">
						<td>
							&nbsp;
						</td>
						<td>
							1601 RODEO RD<br />
							DURANT OK 74701
						</td>
						<td colspan="2">
							R DEBUTANT - Foal
						</td>
					</tr>
					<tr id="HoldData2" class="even">
						<td colspan="2">
							
								<select name="RSPlaceSSNExt2" id="RSPlaceSSNExt2" onchange="putPayeeSSN(this.id,2)">
									<option value="" w9date="">Select Payee</option>
									
										<option 
											w9date="04/20/2007" 
											value="xxx-xx-xxxx-A"
											ssnExt="A"
											AdressBlock="1601 RODEO RD<br />DURANT OK 74701"
											Style="background-color: White;">
											xxx-xx-xxxx-A) JEFF ADAMS
										</option>
									
										<option 
											w9date="05/12/2017" 
											value="xxx-xx-xxxx-A"
											ssnExt="A"
											AdressBlock="1601 RODEO RD<br />DURANT OK 74701"
											Style="background-color: White;">
											xxx-xx-xxxx-A) JEFF ADAMS
										</option>
									
										<option 
											w9date="04/30/2014" 
											value="xxx-xx-xxxx-B"
											ssnExt="B"
											AdressBlock="1601 RODEO RD<br />C/O JEFF ADAMS<br />DURANT OK 74701"
											Style="background-color: White;">
											xxx-xx-xxxx-B) JEFF ADAMS / JOHN C DIEDIKER
										</option>
									
										<option 
											w9date="07/07/2015" 
											value="xxx-xx-xxxx-C"
											ssnExt="C"
											AdressBlock="1601 RODEO RD<br />C/O JEFF ADAMS<br />DURANT OK 74701"
											Style="background-color: White;">
											xxx-xx-xxxx-C) JEFF ADAMS / CATHERINE C FEEMSTER
										</option>
									
								</select>
							
						</td>
						<td colspan="2">
							Holds: 	W9<input type="CheckBox" name="W9Hold2" id="W9Hold2">
									Drug<input type="CheckBox" name="DrugHold2" id="DrugHold2">
									Misc<input type="CheckBox" name="MiscHold2" id="MiscHold2">
							<input type="text" name="MiscHoldComments2" id="MiscHoldComments2" size="25" maxlength="254">
							<img id="Loading2" src="..\includes\ajax-loading-gif-7.gif" height="25" width="25" style="display: none;" />
							<img id="Loading2" src="..\includes\ajax-loading-gif-7.gif" height="25" width="25" style="display: none;" />
							&nbsp;<button name="Submit2" id="Submit2" onclick="postRow(2,12470,'RSPlace')" disabled>Post</button>
						</td>
					</tr>
					<tr id="w9date2" class="even">
						<td style="border-bottom: 1px solid black;">
							&nbsp;
						</td>
						<td id="ClaimsAddress2" style="border-bottom: 1px solid black;">
							
						</td>
						<td colspan="2" id="DisplayRSPlaceSSNExt2" style="border-bottom: 1px solid black;">
							
						</td>
					</tr>
				
					<tr id="RegData3" class="odd">
						<td style="text-align: right;">
							3.
						</td>
						<td>
							
								<a href="IRSLookup.cfm?id=xxx-xx-xxxx" 
									target="_blank">
									xxx-xx-xxxx
								</a>
							JEFF ADAMS and JOHN DIEDIKER
						</td>
						<td>
							RPM2018030901&nbsp;&nbsp;&nbsp Place 
						</td>
						<td style="text-align: right;">
							$306.00
						</td>
					</tr>
					<tr id="PayeeData3" class="odd">
						<td>
							&nbsp;
						</td>
						<td>
							1601 RODEO RD <br />
							DURANT OK 74701
						</td>
						<td colspan="2">
							TURNIN TRICKS - Dam
						</td>
					</tr>
					<tr id="HoldData3" class="odd">
						<td colspan="2">
							
								<select name="DMPlaceSSNExt3" id="DMPlaceSSNExt3" onchange="putPayeeSSN(this.id,3)">
									<option value="" w9date="">Select Payee</option>
									
										<option 
											w9date="04/20/2007" 
											value="xxx-xx-xxxx-A"
											ssnExt="A"
											AdressBlock="1601 RODEO RD<br />DURANT OK 74701"
											Style="background-color: White;">
											xxx-xx-xxxx-A) JEFF ADAMS
										</option>
									
										<option 
											w9date="05/12/2017" 
											value="xxx-xx-xxxx-A"
											ssnExt="A"
											AdressBlock="1601 RODEO RD<br />DURANT OK 74701"
											Style="background-color: White;">
											xxx-xx-xxxx-A) JEFF ADAMS
										</option>
									
										<option 
											w9date="04/30/2014" 
											value="xxx-xx-xxxx-B"
											ssnExt="B"
											AdressBlock="1601 RODEO RD<br />C/O JEFF ADAMS<br />DURANT OK 74701"
											Style="background-color: White;">
											xxx-xx-xxxx-B) JEFF ADAMS / JOHN C DIEDIKER
										</option>
									
										<option 
											w9date="07/07/2015" 
											value="xxx-xx-xxxx-C"
											ssnExt="C"
											AdressBlock="1601 RODEO RD<br />C/O JEFF ADAMS<br />DURANT OK 74701"
											Style="background-color: White;">
											xxx-xx-xxxx-C) JEFF ADAMS / CATHERINE C FEEMSTER
										</option>
									
								</select>
							
						</td>
						<td colspan="2">
							Holds: 	W9<input type="CheckBox" name="W9Hold3" id="W9Hold3">
									Drug<input type="CheckBox" name="DrugHold3" id="DrugHold3">
									Misc<input type="CheckBox" name="MiscHold3" id="MiscHold3">
							<input type="text" name="MiscHoldComments3" id="MiscHoldComments3" size="25" maxlength="254">
							<img id="Loading3" src="..\includes\ajax-loading-gif-7.gif" height="25" width="25" style="display: none;" />
							&nbsp;<button name="Submit3" id="Submit3" onclick="postRow(3,12470,'DMPlace')" disabled>Post</button>
						</td>
					</tr>
					<tr id="w9date3" class="odd">
						<td style="border-bottom: 1px solid black;">
							&nbsp;
						</td>
						<td id="ClaimsAddress3" style="border-bottom: 1px solid black;">
							
						</td>
						<td colspan="2" id="DisplayDMPlaceSSNExt3" style="border-bottom: 1px solid black;">
							
						</td>
					</tr>
				
					<tr id="RegData4" class="even">
						<td style="text-align: right;">
							4.
						</td>
						<td>
							
								<a href="IRSLookup.cfm?id=xxx-xx-xxxx" 
									target="_blank">
									xxx-xx-xxxx
								</a>
							MATT DUNN
						</td>
						<td>
							RPM2018030901&nbsp;&nbsp;&nbsp Place 
						</td>
						<td style="text-align: right;">
							$144.00
						</td>
					</tr>
					<tr id="PayeeData4" class="even">
						<td>
							&nbsp;
						</td>
						<td>
							PO BOX 87<br />
							BISMARCK MO 63624
						</td>
						<td colspan="2">
							CARTEL SUCCESS - Sire
						</td>
					</tr>
					<tr id="HoldData4" class="even">
						<td colspan="2">
							
								<select name="SRPlaceSSNExt4" id="SRPlaceSSNExt4" onchange="putPayeeSSN(this.id,4)">
									<option value="" w9date="">Select Payee</option>
									
										<option 
											w9date="05/01/2008" 
											value="xxx-xx-xxxx-A"
											ssnExt="A"
											AdressBlock="PO BOX 87<br />C/O MATT DUNN<br />BISMARK MO 63624"
											Style="background-color: White;">
											xxx-xx-xxxx-A) DUNN RANCH
										</option>
									
										<option 
											w9date="05/18/2011" 
											value="xxx-xx-xxxx-B"
											ssnExt="B"
											AdressBlock="PO BOX 87<br />C/O MATT DUNN<br />BISMARK MO 63624"
											Style="background-color: White;">
											xxx-xx-xxxx-B) MATT DUNN
										</option>
									
								</select>
							
						</td>
						<td colspan="2">
							Holds: 	W9<input type="CheckBox" name="W9Hold4" id="W9Hold4">
									Drug<input type="CheckBox" name="DrugHold4" id="DrugHold4">
									Misc<input type="CheckBox" name="MiscHold4" id="MiscHold4">
							<input type="text" name="MiscHoldComments4" id="MiscHoldComments4" size="25" maxlength="254">
							<img id="Loading4" src="..\includes\ajax-loading-gif-7.gif" height="25" width="25" style="display: none;" />
							&nbsp;<button name="Submit4" id="Submit4" onclick="postRow(4,12470,'SRPlace')" disabled>Post</button>
						</td>
					</tr>
					<tr id="w9date4" class="even">
						<td style="border-bottom: 1px solid black;">
							&nbsp;
						</td>
						<td id="ClaimsAddress4" style="border-bottom: 1px solid black;">
							
						</td>
						<td colspan="2" id="DisplaySRPlaceSSNExt4" style="border-bottom: 1px solid black;">
							
						</td>
					</tr>
				
					<tr id="RegData5" class="odd">
						<td style="text-align: right;">
							5.
						</td>
						<td>
							
								<a href="IRSLookup.cfm?id=xxx-xx-xxxx" 
									target="_blank">
									xxx-xx-xxxx
								</a>
							JAMES FOBBER
						</td>
						<td>
							RPM2018030901&nbsp;&nbsp;&nbsp Show 
						</td>
						<td style="text-align: right;">
							$300.00
						</td>
					</tr>
					<tr id="PayeeData5" class="odd">
						<td>
							&nbsp;
						</td>
						<td>
							PO BOX 156<br />
							KINTA OK 74552
						</td>
						<td colspan="2">
							JF ROYAL STORM - Foal
						</td>
					</tr>
					<tr id="HoldData5" class="odd">
						<td colspan="2">
							
								<select name="RSShowSSNExt5" id="RSShowSSNExt5" onchange="putPayeeSSN(this.id,5)">
									<option value="" w9date="">Select Payee</option>
									
										<option 
											w9date="07/24/2012" 
											value="xxx-xx-xxxx-A"
											ssnExt="A"
											AdressBlock="PO BOX 156<br />KINTA OK 74552"
											Style="background-color: White;">
											xxx-xx-xxxx-A) JAMES FOBBER
										</option>
									
								</select>
							
						</td>
						<td colspan="2">
							Holds: 	W9<input type="CheckBox" name="W9Hold5" id="W9Hold5">
									Drug<input type="CheckBox" name="DrugHold5" id="DrugHold5">
									Misc<input type="CheckBox" name="MiscHold5" id="MiscHold5">
							<input type="text" name="MiscHoldComments5" id="MiscHoldComments5" size="25" maxlength="254">
							<img id="Loading5" src="..\includes\ajax-loading-gif-7.gif" height="25" width="25" style="display: none;" />
							&nbsp;<button name="Submit5" id="Submit5" onclick="postRow(5,12470,'RSShow')" disabled>Post</button>
						</td>
					</tr>
					<tr id="w9date5" class="odd">
						<td style="border-bottom: 1px solid black;">
							&nbsp;
						</td>
						<td id="ClaimsAddress5" style="border-bottom: 1px solid black;">
							
						</td>
						<td colspan="2" id="DisplayRSShowSSNExt5" style="border-bottom: 1px solid black;">
							
						</td>
					</tr>
				
					<tr id="RegData6" class="even">
						<td style="text-align: right;">
							6.
						</td>
						<td>
							
								<a href="IRSLookup.cfm?id=xxx-xx-xxxx" 
									target="_blank">
									xxx-xx-xxxx
								</a>
							JAMES FOBBER 
						</td>
						<td>
							RPM2018030901&nbsp;&nbsp;&nbsp; Show 
						</td>
						<td style="text-align: right;">
							$204.00
						</td>
					</tr>
					<tr id="PayeeData6" class="even">
						<td>
							&nbsp;
						</td>
						<td>
							PO BOX 156<br />
							KINTA OK 74552
						</td>
						<td colspan="2">
							STORMY CELEBRATION - Dam
						</td>
					</tr>
					<tr id="HoldData6" class="even">
						<td colspan="2">
							
								<select name="DMShowSSNExt6" id="DMShowSSNExt6" onchange="putPayeeSSN(this.id,6)">
									<option value="" w9date="">Select Payee</option>
									
										<option 
											w9date="07/24/2012" 
											value="xxx-xx-xxxx-A"
											ssnExt="A"
											AdressBlock="PO BOX 156<br />KINTA OK 74552"
											Style="background-color: White;">
											xxx-xx-xxxx-A) JAMES FOBBER
										</option>
									
								</select>
							
						</td>
						<td colspan="2">
							Holds: 	W9<input type="CheckBox" name="W9Hold6" id="W9Hold6">
									Drug<input type="CheckBox" name="DrugHold6" id="DrugHold6">
									Misc<input type="CheckBox" name="MiscHold6" id="MiscHold6">
							<input type="text" name="MiscHoldComments6" id="MiscHoldComments6" size="25" maxlength="254">
							<img id="Loading6" src="..\includes\ajax-loading-gif-7.gif" height="25" width="25" style="display: none;" />
							<img id="Loading6" src="..\includes\ajax-loading-gif-7.gif" height="25" width="25" style="display: none;" />
							&nbsp;<button name="Submit6" id="Submit6" onclick="postRow(6,12470,'DMShow')" disabled>Post</button>
						</td>
					</tr>
					<tr id="w9date6" class="even">
						<td style="border-bottom: 1px solid black;">
							&nbsp;
						</td>
						<td id="ClaimsAddress6" style="border-bottom: 1px solid black;">
							
						</td>
						<td colspan="2" id="DisplayDMShowSSNExt6" style="border-bottom: 1px solid black;">
							
						</td>
					</tr>
				
					<tr id="RegData7" class="odd">
						<td style="text-align: right;">
							7.
						</td>
						<td>
							
								<a href="IRSLookup.cfm?id=xxx-xx-xxxx" 
									target="_blank">
									xxx-xx-xxxx
								</a>
							MICHAEL A POHL
						</td>
						<td>
							RPM2018030901&nbsp;&nbsp;&nbsp; Show
						</td>
						<td style="text-align: right;">
							$96.00
						</td>
					</tr>
					<tr id="PayeeData7" class="odd">
						<td>
							&nbsp;
						</td>
						<td>
							2254 STRATTON FOREST HEIGHTS<br />
							COLORADO SPRINGS CO 80906
						</td>
						<td colspan="2">
							KOOL WAGON - Sire
						</td>
					</tr>
					<tr id="HoldData7" class="odd">
						<td colspan="2">
								<select name="SRShowSSNExt7" id="SRShowSSNExt7" onchange="putPayeeSSN(this.id,7)">
									<option value="" w9date="">Select Payee</option>
									
										<option 
											w9date="03/25/2013" 
											value="xxx-xx-xxxx-A"
											ssnExt="A"
											AdressBlock="2254 STRATTON FOREST HEIGHTS<br />C/O MICHAEL A POHL<br />COLORADO SPRINGS CO 80906"
											Style="background-color: White;">
											xxx-xx-xxxx-A) MICHAEL POHL & WARREN BUCK ELK SR
										</option>
									
										<option 
											w9date="03/25/2013" 
											value="xxx-xx-xxxx-B"
											ssnExt="B"
											AdressBlock="2254 STRATTON FOREST HEIGHTS<br />C/O MICHAEL A POHL<br />COLORADO SPRINGS CO 80906"
											Style="background-color: White;">
											xxx-xx-xxxx-B) MICHAEL A POHL / DONALDA POHL
										</option>
									
										<option 
											w9date="06/20/2007" 
											value="xxx-xx-xxxx-C"
											ssnExt="C"
											AdressBlock="2254 STRATTON FOREST HEIGHTS<br />COLORADO SPRINGS CO 80906"
											Style="background-color: White;">
											xxx-xx-xxxx-C) MICHAEL A POHL
										</option>
									
								</select>
							
						</td>
						<td colspan="2">
							Holds:	W9<input type="CheckBox" name="W9Hold7" id="W9Hold7">
									Drug<input type="CheckBox" name="DrugHold7" id="DrugHold7">
									Misc<input type="CheckBox" name="MiscHold7" id="MiscHold7">
							<input type="text" name="MiscHoldComments7" id="MiscHoldComments7" size="25" maxlength="254">
							<img id="Loading7" src="..\includes\ajax-loading-gif-7.gif" height="25" width="25" style="display: none;" />
							&nbsp;<button name="Submit7" id="Submit7" onclick="postRow(7,12470,'SRShow')" disabled>Post</button>
						</td>
					</tr>
					<tr id="w9date7" class="odd">
						<td style="border-bottom: 1px solid black;">
							&nbsp;
						</td>
						<td id="ClaimsAddress7" style="border-bottom: 1px solid black;">
							
						</td>
						<td colspan="2" id="DisplaySRShowSSNExt7" style="border-bottom: 1px solid black;">
							
						</td>
					</tr>
				
		</tbody>
	</table>
</div>
</body>
</html>

Lyndon
 
Hi

There are no magic getters for all kind of unknown properties of the nodes. As the [tt]option[/tt] tag has no w9date and AdressBlock attributes, neither the [tt]HTMLOptionElement[/tt] object has w9date and AdressBlock properties. You can get those values only with the [tt].getAttribute()[/tt] method :
Code:
	[b]function[/b] [COLOR=orange]putPayeeSSN[/color][teal]([/teal]elem[teal],[/teal]row[teal]) {[/teal]
		[b]var[/b] sel[teal]=[/teal]document[teal].[/teal][COLOR=orange]getElementById[/color][teal]([/teal]elem[teal])[/teal]
		[b]if[/b] [teal]([/teal]sel[teal].[/teal]options[teal][[/teal]sel[teal].[/teal]selectedIndex[teal]].[/teal]value[teal].[/teal]length[teal]){[/teal]
			document[teal].[/teal][COLOR=orange]getElementById[/color][teal]([/teal][i][green]'Display'[/green][/i][teal]+[/teal]elem[teal]).[/teal]innerHTML[teal]=[/teal][i][green]'W9 Date: '[/green][/i][teal]+[/teal]sel[teal].[/teal]options[teal][[/teal]sel[teal].[/teal]selectedIndex[teal]].[/teal][highlight][COLOR=orange]getAttribute[/color][teal]([/teal][i][green]'[/green][/i][/highlight][i][green]w9date[/green][/i][highlight][i][green]'[/green][/i][teal])[/teal][/highlight][teal];[/teal]
			document[teal].[/teal][COLOR=orange]getElementById[/color][teal]([/teal][i][green]'W9Hold'[/green][/i][teal]+[/teal]row[teal]).[/teal]checked[teal]=[/teal][b]false[/b][teal];[/teal]
			document[teal].[/teal][COLOR=orange]getElementById[/color][teal]([/teal][i][green]'ClaimsAddress'[/green][/i][teal]+[/teal]row[teal]).[/teal]innerHTML[teal]=[/teal]sel[teal].[/teal]options[teal][[/teal]sel[teal].[/teal]selectedIndex[teal]].[/teal][highlight][COLOR=orange]getAttribute[/color][teal]([/teal][i][green]'[/green][/i][/highlight][i][green]AdressBlock[/green][/i][highlight][i][green]'[/green][/i][teal])[/teal][/highlight][teal];[/teal]
			document[teal].[/teal][COLOR=orange]getElementById[/color][teal]([/teal][i][green]'Submit'[/green][/i][teal]+[/teal]row[teal]).[/teal]disabled[teal]=[/teal][b]false[/b][teal];[/teal]
		[teal]}[/teal] [b]else[/b] [teal]{[/teal]
			document[teal].[/teal][COLOR=orange]getElementById[/color][teal]([/teal][i][green]'Display'[/green][/i][teal]+[/teal]elem[teal]).[/teal]innerHTML[teal]=[/teal][i][green]''[/green][/i][teal];[/teal]
			document[teal].[/teal][COLOR=orange]getElementById[/color][teal]([/teal][i][green]'W9Hold'[/green][/i][teal]+[/teal]row[teal]).[/teal]checked[teal]=[/teal][b]true[/b][teal];[/teal]
			document[teal].[/teal][COLOR=orange]getElementById[/color][teal]([/teal][i][green]'ClaimsAddress'[/green][/i][teal]+[/teal]row[teal]).[/teal]innerHTML[teal]=[/teal][i][green]''[/green][/i][teal];[/teal]
			document[teal].[/teal][COLOR=orange]getElementById[/color][teal]([/teal][i][green]'Submit'[/green][/i][teal]+[/teal]row[teal]).[/teal]disabled[teal]=[/teal][b]true[/b][teal];[/teal]
			
		[teal]}[/teal] [b]return true[/b][teal];[/teal]
	[teal]}[/teal]


Feherke.
feherke.github.io
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top