I have a HTML pager site that pulls in data from a XML file using Javascript allowing the user to select an individual and enter info into the textboxes. They would then click the send button and a page would go out to their pager using a Perl program. I can see the data(just the names) in the dropdown from my XML file in the webpage. I don't want to see the actual pager numbers displayed, but they need to be pulled in by the Perl program. I hope this explanation is clear....
Here's the HTML code:
Here's the JavaScript code:
Here's a partial sample of the XML file:
Thanks
Here's the HTML code:
Code:
<HTML>
<HEAD>
<TITLE>Paging Site</TITLE>
<script language="JavaScript" src="groups.js" type="text/javascript"></script>
<body onload="init();">
<FORM name=myform action=[URL unfurl="true"]http://mycompany.com/cgi-bin/pager/page.pl[/URL] method=post>
<TABLE cellspacing=1 cellpadding=1 width="60%">
<TBODY>
<tr>
<td>
<STRONG>Choose Individual</strong>
<select size=1 id="roleCategoryListing" name="roleCategoryListing" onChange="selectRole(this.value);">
<option>Loading...</option></select><p>
</td>
</tr>
<TR>
<TD valign=top width=144>
<STRONG>Your Name</STRONG>
<INPUT title="Your Name" name=YourName> </TD>
<TD valign=top width=144>
<STRONG>Your Phone
</STRONG><INPUT title="Your Phone Number" maxlength=12 name=YourNumber>
</TD></TR>
<TR valign=top>
<TD colspan=2>
<STRONG>Your Message</STRONG><TEXTAREA title="Your Message" name=YourMessage rows=4 cols=60></TEXTAREA>
</TD></TR>
<TR align=middle>
<TD valign=top colspan=2>
<INPUT type=submit value=Send>
<INPUT onClick=ResetForm() type=reset value=Reset>
</TD>
</TR>
</TBODY>
</TABLE>
</FORM>
</TD></TR>
</BODY>
</HTML>
Here's the JavaScript code:
Code:
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.3.0");
var allRoleListing;
var allRoleCategoryNodes;
var allRoleNodes;
function init(){
xmlDoc.async = false;
xmlDoc.load("./xml/Individual.xml");
allRoleListing = xmlDoc.selectNodes("/IndividualListing");
allRoleCategoryNodes = xmlDoc.selectNodes("//Individual");
allRoleNodes = xmlDoc.selectNodes("//Name");
buildfirstdropdown();
}
function buildfirstdropdown(){
emptyFirstDropDown();
var roleCategoryListSelect = document.getElementById('roleCategoryListing');
var roleListOptions = roleCategoryListSelect.options;
var newOption = document.createElement("option");
newOption.innerHTML = "---Individual---";
newOption.value = "--";
roleCategoryListSelect.appendChild(newOption);
for (var i=0; i<allRoleCategoryNodes.length; i++) {
var thisCategoryNameTxt = allRoleCategoryNodes[i].selectNodes("./Name")[0].text;
var newOption = document.createElement("option");
newOption.innerHTML=thisCategoryNameTxt;
newOption.value = i;
roleCategoryListSelect.appendChild(newOption);
}
}
function emptyFirstDropDown(){
var roleCategoryListingSelect = document.getElementById('roleCategoryListing');
var roleCategoryListingSelectOptions = roleCategoryListingSelect.options;
var roleCategoryListingSelectOptionsLength = roleCategoryListingSelectOptions.length;
for (var i=0; i<roleCategoryListingSelectOptionsLength; i++){
roleCategoryListingSelect.removeChild(roleCategoryListingSelect[0]);
}
}
Here's a partial sample of the XML file:
Code:
<?xml version="1.0" ?>
- <IndividualListing>
- <Individual>
<Name>Aaron, Scott</Name>
<Pager>"6152220365@archwireless.net"</Pager>
</Individual>
- <Individual>
<Name>Wilson, Jeff</Name>
<Pager>"3122257514@archwireless.net"</Pager>
</Individual>
- <Individual>
<Name>Thomas, Ryan</Name>
<Pager>"3129410781@archwireless.net"</Pager>
</Individual>
- <Individual>
<Name>Adams, Naveed</Name>
<Pager>"3129416077@archwireless.net"</Pager>
</Individual>
- <Individual>
</IndividualListing>
Thanks