Hi there
I just need a little help with some issues i am having, using xml data islands.
I have the following function (stripped down currently for ease of debugging)
When i execute this function, xmlid.SRC is as follows:
My problem is occurring on line "objName = xmlid.getElementsByTagName("name");" I receive an error message from IE "Object required" (so informative too)
here is the html in question (again stripped down for simplicity):
Can anyone here see what is going wrong with this?? I use this code in many places and it works, so surely i am just missing something obvious??
cheers in advance (of course if things go as usual, i will solve this myself within the next 5 minutes after posting this) ![[ponder] [ponder] [ponder]](/data/assets/smilies/ponder.gif)
Tracey
Remember... True happiness is not getting what you want...
Its wanting what you have got!
I just need a little help with some issues i am having, using xml data islands.
I have the following function (stripped down currently for ease of debugging)
Code:
function testsubs(user)
{
var strQuery = "";
var objSelect = document.getElementById("group");
var id=objSelect.options[objSelect.selectedIndex].value;
strQuery="select s.subscriptionid, s.datestarted, s.dateexpires, s.custommonthlyrate, t.subscriptiontypeid, t.name " +
"from subscription s join subscriptiontype t on t.subscriptiontypeid = s.subscriptiontypeid " +
"where s.Level1GroupID = " + id;
xmlid.async = false;
xmlid.SRC="/cgi-bin/OSMOS.exe/getsubscription?QString=" + strQuery + "&id=" + user;
//ERROR OCCURS ON THE FOLLOWING LINE:
objName = xmlid.getElementsByTagName("name");
document.getElementById("name").value = objName.item(0).text;
alert("complete");
}
When i execute this function, xmlid.SRC is as follows:
Code:
<?xml version="1.0"?>
<subscriptions>
<subscription>
<name><![CDATA[Free]]></name>
<datestarted><![CDATA[25/10/2006 1:26:09 p.m.]]></datestarted>
<dateexpires><![CDATA[]]></dateexpires>
<custommonthlyrate><![CDATA[]]</custommonthlyrate>
<subscriptiontypeid><![CDATA[1]]</subscriptiontypeid>
<subscriptionid><![CDATA[2]]</subscriptionid>
</subscription>
</subscriptions>
My problem is occurring on line "objName = xmlid.getElementsByTagName("name");" I receive an error message from IE "Object required" (so informative too)
here is the html in question (again stripped down for simplicity):
Code:
<xml id="xmlid"></xml>
<form name="groupform" id="groupform" method="post" class="shown" form action="[URL unfurl="true"]http://aphrodite/cgi-bin/osmos.exe/savesubscription"[/URL]
class=shown onSubmit="return submitonce()">
<input type="hidden" name="ID" value="29">
<table class="post" BGColor="#F4BAD8" width=100%>
<tr BGColor="#F4BAD8">
<td colspan="5">
<h4>Current Subscriptions</h4>
</td><td align=right>
<input type="submit" name="addnew" value="Add New" ID="submitbutton" class="buttontext" onMouseOver="this.className='buttonover';" onMouseOut="this.className='buttontext';" onClick="changeElementClass('addnew', 'shown');">
</td><td></td></tr>
<tr BGColor="#F4BAD8">
<td>
Group
</td><td>
<select name="group" id="group" onChange="testsubs(29);"> //function called
<option value="-1">[SELECT]</option>
<option value="58">DFCoGroup</option>
<option value="60">FrankBobGroup</option>
<option value="68">SithTGroup</option>
<option value="70">CatalystGroup</option>
<option value="55">MadsoftGroup</option>
</select>
</td></tr>
</table>
</form>
<form action="[URL unfurl="true"]http://aphrodite/cgi-bin/osmos.exe/savesubscription"[/URL] name="addnew" method=post id="addnew" onSubmit="return submitonce()" class="hidden">
<input type="HIDDEN" name="ID" value ="29">
<table class="post" BGColor="#F4BAD8" width=100%>
<tr BGColor="#F4BAD8">
<td><strong>Name</strong></td><td><input type="text" id="name" name="name" value=""></td></tr>
</td></tr>
</table>
</form>
Can anyone here see what is going wrong with this?? I use this code in many places and it works, so surely i am just missing something obvious??
![[cheers] [cheers] [cheers]](/data/assets/smilies/cheers.gif)
![[ponder] [ponder] [ponder]](/data/assets/smilies/ponder.gif)
Tracey
Remember... True happiness is not getting what you want...
Its wanting what you have got!