We help IT Professionals succeed at work.

Integrating JS with .net

nigerman
nigerman asked
on
1,000 Views
Last Modified: 2010-05-19
Hello again .net experts.

I have a javascript onload event that triggers a different information to load once a certain value is selected.

For instance, if I check the vpn box, a form with vpn instructions is loaded to the screen.

This works well with classic asp but when I tried using it with .net (vb) framework 2.0,  I get 2 errors as shown below:
document.cform.service.value is null or not an object
and

Profile.selectedIndex is null or not an object.

That's because service is a choice in the CheckBoxList control while Profile is an option in the DropDownList.

Below is the JavaScript code, can someone please help me integrate this with my code.

function load(){

if (document.cform.service.value.indexOf("VPN") >= 0){
      document.getElementById("vpn").style.visiblilty="visible";
      document.getElementById("vpn").style.display="block";
      
}
if (document.cform.service.value.indexOf("iasWorld") >= 0){
            document.getElementById("iasConnType").style.visiblilty="visible";
            document.getElementById("iasConnType").style.display="block";
}
if (document.cform.AgencyName.value == "Tax Assessor"){
var iasconn = "";
      for (var i = 0;i<document.cform.iasConnection.length;i++){
            if (document.cform.iasConnection.options[i].selected== true){iasconn += document.cform.iasConnection.options[i].value+ ", ";}
      }
if (iasconn.indexOf("iasWorld") >= 0){
            document.getElementById("iasWorldTaxAss").style.visiblilty="visible";
            document.getElementById("iasWorldTaxAss").style.display="block";
}
if (iasconn.indexOf("ClientServer") >= 0){
            document.getElementById("ClientServerTaxAss").style.visiblilty="visible";
            document.getElementById("ClientServerTaxAss").style.display="block";
}
}

show_clock();

}
Comment
Watch Question

Christopher KileSenior Software Analyst
CERTIFIED EXPERT

Commented:
Why don't you try using getElementById() for everything?   It may no longer be visible at the level of the form using dot notation, but GetElementById() should winkle it out from whatever place it lives as long as it's on the page.

Author

Commented:
thanks for your prompt response cpkilekofp!

In other words, instead of this for instance:
function load(){

if (document.cform.service.value.indexOf("VPN") >= 0){
      document.getElementById("vpn").style.visiblilty="visible";
      document.getElementById("vpn").style.display="block";
     
}

use this:

function load(ld){

if (ld.service.value.indexOf("VPN") >= 0){
      document.getElementById("vpn").style.visiblilty="visible";
      document.getElementById("vpn").style.display="block";
     
}
etc???

In one of my earlier posts, this wizard by the name of Tim suggested that I put the event in the page_load event handler.

He gave me this code:
        AgencyName.Attributes.Add("onchange", "agencyChange(this);")

How should I phrase the syntax for the load() function in the page_load event handler?


Christopher KileSenior Software Analyst
CERTIFIED EXPERT

Commented:
Most of the time, I simply insert the script block into the HTML, as:

<script type='text/javascript' language='javascript'>
// <!--

insert your script code here; the comment slashes hide the HTML comma delimiters, and the HTML comma delimiters hide the Javascript from browser processing.

// -->
</script>

You can also register the script from your code-behind:

        scriptBlock = ""
        scriptBlock &= "<script type='text/javascript'>" & vbCrLf
        scriptBlock &= "<!--" & vbCrLf
        scriptBlock &= vbTab & "var el = document.getElementById('" & firstFocusField & "');" & vbCrLf
        scriptBlock &= vbTab & "el.focus();" & vbCrLf
        scriptBlock &= "//-->" & vbCrLf
        scriptBlock &= "</script>" & vbCrLf

        thePage.RegisterStartupScript("SetFocus", scriptBlock)

Author

Commented:
You said:
>>Most of the time, I simply insert the script block into the HTML, as:
>><script type='text/javascript' language='javascript'>
// <!--

That's what I did with the code I posted earlier.

Why then am I having the errors below?
Do you know how I can correc them?

document.cform.service.value is null or not an object
and
Profile.selectedIndex is null or not an object.
Christopher KileSenior Software Analyst
CERTIFIED EXPERT

Commented:
As I indicated earlier, I don't believe that ASP.NET permits document.form.list choice.value; use getElementById("list choice").value instead.  As for Profile, you don't mention it in the code you supplied earlier - the only mention you've provided so far is in the error report.

Author

Commented:
I think I follow your point now but can you please help me with one more thing?

I did an extensive research and found that I could use the following syntax:

document.forms[0].txtservice or whatever the form element is.

I tried that but when I Viewed the HTML source code, I found out that txtservice is not even anywhere on the code!

I am using Multiview to give the impression that I am going from page to page.

Do you or does anyone know if that was the reason I could not see txtservice?

I could see everthing else.

I hope I can get some help.
Christopher KileSenior Software Analyst
CERTIFIED EXPERT

Commented:
Multiview? The Multiview class, or is this some product?  

Author

Commented:
Multiview class
Christopher KileSenior Software Analyst
CERTIFIED EXPERT

Commented:
If you are using the Multiview class, is txtservice in the currently selected View?

Author

Commented:
that's the only way I know how to accomplish what I was trying to accomplish.

So, The layout is like:

<form id="cform">
<asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
<view1> </view1>
<view2> </view2>
</Multiview>

Now the txtservice element and a couple more are in view1 and the rest are in view2

My js is at <head></head>

When I view html source, I see everything in view2 but not view1.
Christopher KileSenior Software Analyst
CERTIFIED EXPERT

Commented:
It would help greatly if you would type in exactly what's in your web page (paste it if necessary), as what you've written is incorrect vocabulary and syntax for defining a Multiview (see http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.multiview.aspx) and I can't even guess what the real problem is until I see exactly what you're trying to use.

Author

Commented:
Ok, please don't hate me or run away because it is lengthy but please pay attention *ONLY* to function load() and the CheckboxList control with id txtservice under View1.

Basically, what I would like to accomplish is that if a user checks the VPN box, a form with instructions (which is near the bottom of page) is shown.

Here is the code:

<%@ Page Language="VB" AutoEventWireup="true"  CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
      <title>Service Request Form</title>
      <style type="text/css">
            body { font-family: arial; font-size: 10pt; }
            table { background-color: #eeeeee; margin-bottom: 10px; }
      </style>
<style type="text/css">
<!--
.vpn  {display:none;}
.hideme {display:none;}
-->
</style>


<script Language="JavaScript" Type="text/javascript"><!--

function load(){

if (document.forms[0].txtservice.value.indexOf("VPN") >= 0){
    document.getElementById("vpn").style.visiblilty="visible";
    document.getElementById("vpn").style.display="block";
     
}
if (document.forms[0].txtservice.value.indexOf("iasWorld") >= 0){
        document.getElementById("iasConnType").style.visiblilty="visible";
        document.getElementById("iasConnType").style.display="block";
}
if (document.forms[0].AgencyName.value == "Tax Assessor"){
var iasconn = "";
    for (var i = 0;i<document.cform.iasConnection.length;i++){
        if (document.forms[0].iasConnection.options[i].selected== true){iasconn += document.forms[0].iasConnection.options[i].value+ ", ";}
    }
if (iasconn.indexOf("iasWorld") >= 0){
        document.getElementById("iasWorldTaxAss").style.visiblilty="visible";
        document.getElementById("iasWorldTaxAss").style.display="block";
}
if (iasconn.indexOf("ClientServer") >= 0){
        document.getElementById("ClientServerTaxAss").style.visiblilty="visible";
        document.getElementById("ClientServerTaxAss").style.display="block";
}
}

show_clock();

}

function agencyChange(an){
      if (an.value != "Tax Assessor"){
            document.getElementById("iasWorldTaxAss").style.visiblilty="hidden";
            document.getElementById("iasWorldTaxAss").style.display="none";
            document.getElementById("ClientServerTaxAss").style.visiblilty="hidden";
            document.getElementById("ClientServerTaxAss").style.display="none";
      }
}

function iasConnetion(cn){
      var iasconn = "";
      for (var i = 0;i<cn.iasConnection.length;i++){
            if (cn.iasConnection.options[i].selected== true){iasconn += cn.iasConnection.options[i].value+ ", ";}
      }
      if (cn.AgencyName.value == "Tax Assessor"){
            if (iasconn.indexOf("iasWorld") >= 0){
                  document.getElementById("iasWorldTaxAss").style.visiblilty="visible";
                  document.getElementById("iasWorldTaxAss").style.display="block";
            }else{
                  document.getElementById("iasWorldTaxAss").style.visiblilty="hidden";
                  document.getElementById("iasWorldTaxAss").style.display="none";
            }
            if (iasconn.indexOf("ClientServer") >= 0){
                  document.getElementById("ClientServerTaxAss").style.visiblilty="visible";
                  document.getElementById("ClientServerTaxAss").style.display="block";
            }else{
                  document.getElementById("ClientServerTaxAss").style.visiblilty="hidden";
                  document.getElementById("ClientServerTaxAss").style.display="none";
            }
      }
}
//--></script>


</head>
<body onload="show_clock(),load();">

            <div align="center">
                  <table borderColor="black" cellSpacing="0" cellPadding="0" border="1">
                        <tr>
                              <td><IMG height="75" src="images/home_top_01.jpg" width="100" border="0"><IMG height="75" src="images/home_top_02.jpg" width="314" border="0"><IMG height="75" src="images/home_top_03.jpg" width="330" border="0">
                                    <CENTER></CENTER>
                                    <br>
                                    <p align="left"><font color="#000080" size="6">
                                                      <center><u>ACCESS FORM</u></center>
                                                </font><font size="4"><p>
                                                            <%Dim dt As DateTime = DateTime.Now
                                                                Dim dtFormat As String
                                                                dtFormat = dt.ToString("dddd , MMMM d yyyy")
                                         %>
                                                            <font color="#ff0000" size="4"><i>All Boxes with * must be Completed</i></font>
                                                            &nbsp;&nbsp;&nbsp;<font size="2"><%= dtFormat %></font>-
                                                            <script language="javascript" src="js/liveclock_lite.js"></script>
                                                </font>
                                    </p>
 <center><img src="images/lines.jpg" border="0"></center>

      <form id="cform" runat="server">
      <div>
            <asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
                  <asp:View ID="View1" runat="server">
            
             <font color="#ff0000">Please Specify the Connection (s) and/or Application (s) by checking the appropriate box</font>
                                                <table cellSpacing="0" cellPadding="4" width="100%" border="0">
                                                      <tr>
                                                            <td nowrap align="center" style="width: 61%">

                                                                        <asp:CheckBoxList id="txtservice" repeatcolumns="6" RepeatDirection="Horizontal" runat="server">
                                                                              <asp:ListItem Value="Seagull" Selected="False">Seagull</asp:ListItem>
                                                                              <asp:ListItem Value="Email">Email</asp:ListItem>
                                                                              <asp:ListItem Value="Mainframe">Mainframe</asp:ListItem>
                                                                              <asp:ListItem Value="Cubis">Cubis</asp:ListItem>
                                                                              <asp:ListItem Value="Banner">Banner</asp:ListItem>
                                                                              <asp:ListItem Value="JDL">JDL</asp:ListItem>
                                                                              <asp:ListItem Value="Tiburon">OTiburon</asp:ListItem>
                                                                              <asp:ListItem Value="iasWorld">iasWorld</asp:ListItem>
                                                                              <asp:ListItem Value="Notary">Notary</asp:ListItem>
                                                                              <asp:ListItem Value="VPN">VPN</asp:ListItem>
                                                                              <asp:ListItem Value="VPSPagecenter">VPS-Pagecenter</asp:ListItem>
                                                                              <asp:ListItem Value="PCDOC">PC DOC</asp:ListItem>
                                                                        </asp:CheckBoxList>
                                                                        <asp:CheckBoxList id="txtCheck" RepeatDirection="Horizontal" runat="server">
                                                                              <asp:ListItem Value="Personnel.Userreq@yahoo.com;" Selected="False">GHRS</asp:ListItem>
                                                                              <asp:ListItem Value="Taxcomm.Userreq@yahoo.com;">OASIS</asp:ListItem>
                                                                              <asp:ListItem Value="TaxAssessor.Userrequest@yahoo.com;">CAMA</asp:ListItem>
                                                                        </asp:CheckBoxList>
                                                            </td>
                                                      </tr>
                                                </table>
                                                <center><img src="images/lines.jpg" border="0"></center>
                                                <p align="center"><font color="#000080" size="5"><b>Authorized Requestor</b></font></p>
                                                <TABLE WIDTH="95%" BORDER="0" CELLSPACING="0" CELLPADDING="1">
                                                      <TR>
                                                            <TD width="338">
                                                                  Name<font color="red">*</font> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                                  <asp:TextBox id="txtAuthName" runat="server" Width="186px"></asp:TextBox>
                                                            </TD>
                                                            <TD>&nbsp;Job Title<font color="red">*</font> &nbsp;
                                                                  <asp:TextBox id="txtAuthJob" runat="server" Width="254px"></asp:TextBox></TD>
                                                      </TR>
                                                      <TR>
                                                            <TD width="338">Work Phone<font color="red">*</font>&nbsp;
                                                                  <asp:TextBox id="txtAuthPhone" runat="server" Width="186px"></asp:TextBox></TD>
                                                            <TD>&nbsp;Email<font color="red">*</font> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                                  <asp:TextBox id="txtAuthEmail" runat="server" Width="253px"></asp:TextBox></TD>
                                                      </TR>
                                                      <tr>
                                                            <td>&nbsp;</td>
                                                      </tr>
                                                </TABLE>

                </asp:View>
                  <asp:View ID="View2" runat="server">
                                    <p align="center"><font color="#000080" size="5"><b>User Information</b></font></p>
                                    <TABLE cellSpacing="0" cellPadding="2" width="95%" bgColor="#ffffff" border="0">
                                          <TR>
                                                <TD vAlign="top" align="center">
                                                      <TABLE>
                                                            <TR>
                                                                  <td ALIGN="right"><FONT class="Arial10"><B>Profile<font color="#ff0000">*</font></B></FONT></td>
                                                                  <td><asp:dropdownlist id="eProfile" runat="server" Width="144px">
                                                                              <asp:listitem Value="" Selected="True">--Select A Profile--</asp:listitem>
                                                                              <asp:listitem Value="Add Profile">Add Profile</asp:listitem>
                                                                              <asp:listitem Value="Delete Profile">Delete Profile</asp:listitem>
                                                                              <asp:listitem Value="Update Profile">Update Profile</asp:listitem>
                                                                              <asp:listitem Value="Transfer">Transfer</asp:listitem>
                                                                              <asp:listitem Value="See Notes">See Notes</asp:listitem>
                                                                        </asp:dropdownlist></td>
                                                            </TR>
                                                            <tr>
                                                                  <td ALIGN="right">Last Name<font color="#ff0000">*</font></td>
                                                                  <td><asp:textbox id="LastName" runat="server"></asp:textbox></td>
                                                            </tr>
                                                            <tr>
                                                                  <td ALIGN="right">First Name<font color="#ff0000">*</font></td>
                                                                  <td><asp:textbox id="FirstName" runat="server"></asp:textbox></td>
                                                            </tr>
                                                            <tr>
                                                                  <td ALIGN="right">Mid Initial<font color="#ff0000">*</font></td>
                                                                  <td><asp:textbox id="MidInitial" runat="server"></asp:textbox></td>
                                                            </tr>
                                                            <tr>
                                                                  <td ALIGN="right">SSN&nbsp; XXX-XX-</td>
                                                                  <td><asp:TextBox id="SSN" runat="server" Width="39px" Text="XXXX"></asp:TextBox></td>
                                                            </tr>
                                                            <tr>
                                                                  <td ALIGN="right">
                                                                        Mother Maiden&nbsp;Name</td>
                                                                  <td><asp:TextBox id="MotherMaidenName" runat="server"></asp:TextBox></td>
                                                            </tr>
                                                            <tr>
                                                                  <td ALIGN="right">
                                                                        Job Title<font color="#ff0000">*</font></td>
                                                                  <td><asp:TextBox id="JobTitle" runat="server"></asp:TextBox></td>
                                                            </tr>
                                                            <tr>
                                                                  <td ALIGN="right">
                                                                        Agency Name<font color="#ff0000">*</font></td>
                                                                  <td><asp:dropdownlist id="AgencyName" runat="server" Width="144px">
                                                                              <asp:listitem Value="" Selected="True">--Select A Department--</asp:listitem>
                                                                              <asp:listitem Value="Arts Council">Arts Council</asp:listitem>
                                                                              <asp:listitem Value="Atlanta / Fulton Public Library">Atlanta / Fulton Public Library</asp:listitem>
                                                                              <asp:listitem Value="Board of Commissioners">Board of Commissioners</asp:listitem>
                                                                              <asp:listitem Value="Clerk of Superior Court">Clerk of Superior Court</asp:listitem>
                                                                              <asp:listitem Value="Communications">Communications</asp:listitem>
                                                                              <asp:listitem Value="Cooperative Extension Service">Cooperative Extension Service</asp:listitem>
                                                                              <asp:listitem Value="County Attorney">County Attorney</asp:listitem>
                                                                              <asp:listitem Value="County Manager">County Manager</asp:listitem>
                                                                              <asp:listitem Value="County Marshal">County Marshal</asp:listitem>
                                                                              <asp:listitem Value="District Attorney">District Attorney</asp:listitem>
                                                                              <asp:listitem Value="Economic Development">Economic Development</asp:listitem>
                                                                              <asp:listitem Value="Emergency Services">Emergency Services</asp:listitem>
                                                                              <asp:listitem Value="Environment and Community Development">Environment and Community Development</asp:listitem>
                                                                              <asp:listitem Value="Finance">Finance</asp:listitem>
                                                                              <asp:listitem Value="Fire Department">Fire Department</asp:listitem>
                                                                              <asp:listitem Value="General Services">General Services</asp:listitem>
                                                                              <asp:listitem Value="Health and Wellness">Health and Wellness</asp:listitem>
                                                                              <asp:listitem Value="Housing Authority of DC">Housing Authority of DC</asp:listitem>
                                                                              <asp:listitem Value="Human Services">Human Services</asp:listitem>
                                                                              <asp:listitem Value="Information Technology">Information Technology</asp:listitem>
                                                                              <asp:listitem Value="Juvenile Court">Juvenile Court</asp:listitem>
                                                                              <asp:listitem Value="Medical Examiner">Medical Examiner</asp:listitem>
                                                                              <asp:listitem Value="Mental Health">Mental Health</asp:listitem>
                                                                              <asp:listitem Value="Parks and Recreation">Parks and Recreation</asp:listitem>
                                                                              <asp:listitem Value="Personnel">Personnel</asp:listitem>
                                                                              <asp:listitem Value="Police">Police</asp:listitem>
                                                                              <asp:listitem Value="Probate Court">Probate Court</asp:listitem>
                                                                              <asp:listitem Value="Public Defender">Public Defender</asp:listitem>
                                                                              <asp:listitem Value="Public Works">Public Works</asp:listitem>
                                                                              <asp:listitem Value="Purchasing">Purchasing</asp:listitem>
                                                                              <asp:listitem Value="Registration and Elections">Registration and Elections</asp:listitem>
                                                                              <asp:listitem Value="Sheriff">Sheriff</asp:listitem>
                                                                              <asp:listitem Value="Solicitor General">Solicitor General</asp:listitem>
                                                                              <asp:listitem Value="State Court Judges">State Court Judges</asp:listitem>
                                                                              <asp:listitem Value="State Court">State Court</asp:listitem>
                                                                              <asp:listitem Value="State Court - Magistrate Court">State Court - Magistrate Court</asp:listitem>
                                                                              <asp:listitem Value="Superior Court Judges">Superior Court Judges</asp:listitem>
                                                                              <asp:listitem Value="Superior Court">Superior Court</asp:listitem>
                                                                              <asp:listitem Value="Tax Assessor">Tax Assessor</asp:listitem>
                                                                              <asp:listitem Value="Tax Commissioner">Tax Commissioner</asp:listitem>
                                                                        </asp:dropdownlist></td>
                                                            </tr>
                                                            <tr>
                                                                  <td ALIGN="right">
                                                                        Agency No</td>
                                                                  <td><asp:TextBox id="AgencyNo" runat="server"></asp:TextBox></td>
                                                            </tr>
                                                            <tr>
                                                                  <td ALIGN="right">Notary Initial</td>
                                                                  <td><asp:TextBox id="NotaryInitial" runat="server"></asp:TextBox></td>
                                                            </tr>
                                                      </TABLE>
                                                </TD>
                                                <TD VALIGN="top" ALIGN="center">
                                                      <TABLE BORDER="1" CELLSPACING="0" CELLPADDING="4" BORDERCOLOR="#ffffff">
                                                            <TR>
                                                                  <td ALIGN="right">
                                                                        Org Name
                                                                  </td>
                                                                  <td><asp:TextBox id="OrgName" runat="server"></asp:TextBox></td>
                                                            </TR>
                                                            <tr>
                                                                  <td ALIGN="right">Org No</td>
                                                                  <td><asp:TextBox id="OrgNo" runat="server"></asp:TextBox></td>
                                                            </tr>
                                                            <tr>
                                                                  <td ALIGN="right">Phone<font color="#ff0000">*</font></td>
                                                                  <td><asp:TextBox id="Phone" runat="server"></asp:TextBox></td>
                                                            </tr>
                                                            <tr>
                                                                  <td ALIGN="right">Address<font color="#ff0000">*</font></td>
                                                                  <td><asp:TextBox id="StAddress" runat="server"></asp:TextBox></td>
                                                            </tr>
                                                            <tr>
                                                                  <td ALIGN="right">Suite<font color="#ff0000">*</font></td>
                                                                  <td><asp:TextBox id="SecAddress" runat="server"></asp:TextBox></td>
                                                            </tr>
                                                            <tr>
                                                                  <td ALIGN="right">City<font color="#ff0000">*</font></td>
                                                                  <td><asp:TextBox id="City" runat="server"></asp:TextBox></td>
                                                            </tr>
                                                            <tr>
                                                                  <td ALIGN="right">Zip<font color="#ff0000">*</font></td>
                                                                  <td><asp:TextBox id="Zip" runat="server"></asp:TextBox></td>
                                                            </tr>
                                                            <tr>
                                                                  <td ALIGN="right">Vendor</td>
                                                                  <td><asp:TextBox id="company" runat="server"></asp:TextBox></td>
                                                            </tr>
                                                      </TABLE>
                                                </TD>
                                          </TR>
                                    </TABLE>
                                    
                                    <center><img src="images/lines.jpg"></center>
                                    <br>
                                    <center>
                                          <table cellpadding="0" cellspacing="0" width="100%" height="22">
                                                <TBODY>
                                                      <tr>
                                                            <td><center><b>Please Specify User ID for <font color="#ff0000">CESN, BANNER/TIBURON, PC DOC </font>
                                                                        to be modeled after.</b></center></td>
                                      </tr>
      
                               <tr>
                              <td><center><asp:TextBox id="UserID" Rows="89" maxLength="255" runat="server"></asp:TextBox></center>
                              </td>
                        </tr>
                    </TBODY>
                  </table>
                  </CENTER><br>
                  
                  <center><img src="images/lines.jpg"></center>
                  <br>
                  <center><font color="#000080" size="5"><b>VPS - PAGECENTER</b></font></center>
                  <br>
                  <center>
                              <table cellpadding="0" cellspacing="0" width="90%" height="22">
                                    <tr>
                                          <TD><b>Application</b></TD>
                                          <TD><b>Mailbox</b></TD>
                                          <TD><b>Printer</b></TD>
                                          <TD><b>Bundle</b></TD>
                                    </tr>
                                    <tr>
                                          <td><asp:TextBox id="VSPapp" Rows="20" maxLength="255" runat="server"></asp:TextBox></td>
                                          <td><asp:TextBox id="VPSmailbox" Rows="20" maxLength="255" runat="server"></asp:TextBox></td>
                                          <td><asp:TextBox id="VPSprinter" Rows="20" maxLength="255" runat="server"></asp:TextBox></td>
                                          <td><asp:TextBox id="VPSbundle" Rows="20" maxLength="255" runat="server"></asp:TextBox></td>
                                    </tr>
                              </table>
                        </center>
                        <br>                                    
                                    
      
                              <center><img src="images/lines.jpg"></center>
                        <br>
                        <p><font color="#ff0000"><center>Hold the Ctrl key to select more than one level From the
                                          following dropdown listboxes</center>
                              </font>
                        <P></P>
                        <div align="center">
                              <table cellpadding="0" cellspacing="0" width="90%" height="22">
                                    <tr>
                                          <td align="center"><b>GHRS level&nbsp;&nbsp; </b>
                                                <BR>
                                                <asp:ListBox id="GHRSlevel" runat="server" SelectionMode="Multiple" Rows="5" Width="144px">
                                                      <asp:listitem Value="None" Selected="True">--Select A Department--</asp:listitem>
                                                      <asp:listitem Value="Single Department Read Access">Single Department Read Access</asp:listitem>
                                                      <asp:listitem Value="Dept Internal Upd Level I">Dept Internal Upd Level I</asp:listitem>
                                                      <asp:listitem Value="Dept Internal Upd Level II">Dept Internal Upd Level II</asp:listitem>
                                                      <asp:listitem Value="Dept Final Update">Dept Final Update</asp:listitem>
                                                      <asp:listitem Value="Full County Read Access">Full County Read Access</asp:listitem>
                                                      <asp:listitem Value="Position Control Update">Position Control Update</asp:listitem>
                                                      <asp:listitem Value="Workers Comp Internal Upd">Workers Comp Internal Upd</asp:listitem>
                                                      <asp:listitem Value="Workers Comp Final Upd">Workers Comp Final Upd</asp:listitem>
                                                      <asp:listitem Value="Personnel Internal Upd">Personnel Internal Upd</asp:listitem>
                                                      <asp:listitem Value="Personnel Final Upd">Personnel Final Upd</asp:listitem>
                                                      <asp:listitem Value="Finance Interal Upd">Finance Interal Upd</asp:listitem>
                                                      <asp:listitem Value="Finance Final Upd">Finance Final Upd</asp:listitem>
                                                      <asp:listitem Value="Pers Master Table Upd">Pers Master Table Upd</asp:listitem>
                                                      <asp:listitem Value="Finance Master Table Upd">Finance Master Table Upd</asp:listitem>
                                                      <asp:listitem Value="Workers Comp Master Table Upd">Workers Comp Master Table Upd</asp:listitem>
                                                      <asp:listitem Value="Other - see notes -">Other - see notes -</asp:listitem>
                                                </asp:ListBox></td>
                                          <td align="center"><b>OASIS Level </b>
                                                <BR>
                                                <asp:ListBox id="OASIAlevel" runat="server" SelectionMode="Multiple" Rows="5" Width="144px">
                                                      <asp:listitem Value="None" Selected="True">--Select A Department--</asp:listitem>
                                                      <asp:listitem Value="Inquiry 1">Inquiry 1</asp:listitem>
                                                      <asp:listitem Value="Inquiry 2">Inquiry 2</asp:listitem>
                                                      <asp:listitem Value="Entry 1">Entry 1</asp:listitem>
                                                      <asp:listitem Value="Entry 2">Entry 2</asp:listitem>
                                                      <asp:listitem Value="Entry 3">Entry 3</asp:listitem>
                                                      <asp:listitem Value="Accountant">Accountant</asp:listitem>
                                                      <asp:listitem Value="Accountant 4">Accountant 4</asp:listitem>
                                                      <asp:listitem Value="Accountant 5">Accountant 5</asp:listitem>
                                                      <asp:listitem Value="Admin">Admin</asp:listitem>
                                                      <asp:listitem Value="Admin 2">Admin 2</asp:listitem>
                                                      <asp:listitem Value="Personal Prop Inq">Personal Prop Inq</asp:listitem>
                                                      <asp:listitem Value="Personal Prop Entry 1">Personal Prop Entry 1</asp:listitem>
                                                      <asp:listitem Value="Personal Prop Entry 2">Personal Prop Entry 2</asp:listitem>
                                                      <asp:listitem Value="Cashier 1">Cashier 1</asp:listitem>
                                                      <asp:listitem Value="Cashier 2">Cashier 2</asp:listitem>
                                                      <asp:listitem Value="Other - see notes -">Other ----------see notes--------</asp:listitem>
                                                </asp:ListBox></td>
                                          <td align="center"><b>CAMA Level</b><BR>
                                                <asp:ListBox id="CAMALevel" runat="server" SelectionMode="Multiple" Rows="5"  Width="144px">
                                                      <asp:listitem Value="None" Selected="True">--Select A Department--</asp:listitem>
                                                      <asp:listitem Value="CAMA D/M">CAMA D/M</asp:listitem>
                                                      <asp:listitem Value="Sales Inquiry">Sales Inquiry</asp:listitem>
                                                      <asp:listitem Value="Market Valuation">Market Valuation</asp:listitem>
                                                      <asp:listitem Value="Bacth Report Request">Bacth Report Request</asp:listitem>
                                                      <asp:listitem Value="Appraisal Control">Appraisal Control</asp:listitem>
                                                      <asp:listitem Value="Selectability">Selectability</asp:listitem>
                                                      <asp:listitem Value="Parm Maintenance">Parm Maintenance</asp:listitem>
                                                      <asp:listitem Value="Hearing Tracking">Hearing Tracking</asp:listitem>
                                                      <asp:listitem Value="Security">Security</asp:listitem>
                                                      <asp:listitem Value="AMS Reports">AMS Reports</asp:listitem>
                                                      <asp:listitem Value="Building Permits">Building Permits</asp:listitem>
                                                      <asp:listitem Value="Other - see notes -">Other ----------see notes--------</asp:listitem>
                                                </asp:ListBox></td>
                                    </tr>
                              </table>
                        </div>
                                                      
                        <center><b>Notes</b><br>
                                    <asp:TextBox id="Notes" rows="5" Columns="78" TextMode="MultiLine" runat="server"></asp:TextBox></center>
                              <br>
                        <P></P>
                        <div id="iasConnType" class="hideme">
                              <p align="center">
                                          <font size="3">Select The iasWorld Connection Type</font>
                                          <asp:ListBox id="iasConnection" runat="server" SelectionMode="Multiple" Rows="2" Width="144px">
                                                <asp:listitem Value="iasWorld">iasWorld</asp:listitem>
                                                <asp:listitem Value="ClientServer">Client-Server</asp:listitem>
                                          </asp:ListBox>
                                    </p>
                              <P></P>
                        </div>

                        <div id="iasWorldTaxAss" class="hideme">
                              <center>
                                    <h3>Please Select The iasWorld Primary Role</h3>
                                          <asp:dropdownlist id="iasTaxAPri" runat="server" Width="144px">
                                                <asp:listitem Value="Assessor_View_Only">Assessor_View_Only</asp:listitem>
                                                <asp:listitem Value="BE_ADMIN">BE_ADMIN</asp:listitem>
                                                <asp:listitem Value="CUVA">CUVA</asp:listitem>
                                                <asp:listitem Value="Fbook">Fbook</asp:listitem>
                                                <asp:listitem Value="Fbook_DE">Fbook_DE</asp:listitem>
                                                <asp:listitem Value="Fbook_Sup">Fbook_Sup</asp:listitem>
                                                <asp:listitem Value="Homestead">Homestead</asp:listitem>
                                                <asp:listitem Value="Homestead_Tech">Homestead_Tech</asp:listitem>
                                                <asp:listitem Value="Personal">Personal</asp:listitem>
                                                <asp:listitem Value="Personal_HT">Personal_HT</asp:listitem>
                                                <asp:listitem Value="Personal_misc">Personal_misc</asp:listitem>
                                                <asp:listitem Value="PP_Manager">PP_Manager</asp:listitem>
                                                <asp:listitem Value="PP_Prior">PP_Prior</asp:listitem>
                                                <asp:listitem Value="TA_CI_APPR">TA_CI_APPR</asp:listitem>
                                                <asp:listitem Value="TA_CI_data_List">TA_CI_data_List</asp:listitem>
                                                <asp:listitem Value="TA_CI_DE">TA_CI_DE</asp:listitem>
                                                <asp:listitem Value="TA_CI_Mgr">TA_CI_Mgr</asp:listitem>
                                                <asp:listitem Value="TA_CL_DE">TA_CL_DE</asp:listitem>
                                                <asp:listitem Value="TA_CL_FS_Admn">TA_CL_FS_Admn</asp:listitem>
                                                <asp:listitem Value="TA_CL_FS_II">TA_CL_FS_II</asp:listitem>
                                                <asp:listitem Value="TA_CL_FS_Suprv">TA_CL_FS_Suprv</asp:listitem>
                                                <asp:listitem Value="TA_RS_Appr">TA_RS_Appr</asp:listitem>
                                                <asp:listitem Value="TA_RS_Appr_Trnee">TA_RS_Appr_Trnee</asp:listitem>
                                                <asp:listitem Value="TA_RS_Mgr">TA_RS_Mgr</asp:listitem>
                                                <asp:listitem Value="TA_RS_SR_Appr">TA_RS_SR_Appr</asp:listitem>
                                                <asp:listitem Value="TIMBER">TIMBER</asp:listitem>
                                          </asp:dropdownlist>
                                          <h3>Please Select The Secondary iasWorld Role(s)</h3>
                                          <asp:ListBox id="iasTaxA" runat="server" SelectionMode="Multiple" Rows="9" Width="144px">
                                                <asp:listitem Value="Assessor_View_Only">Assessor_View_Only</asp:listitem>
                                                <asp:listitem Value="BE_ADMIN">BE_ADMIN</asp:listitem>
                                                <asp:listitem Value="Customer_Service">Customer_Service</asp:listitem>
                                                <asp:listitem Value="CUVA">CUVA</asp:listitem>
                                                <asp:listitem Value="Fbook">Fbook</asp:listitem>
                                                <asp:listitem Value="Fbook_DE">Fbook_DE</asp:listitem>
                                                <asp:listitem Value="Fbook_Sup">Fbook_Sup</asp:listitem>
                                                <asp:listitem Value="Homestead">Homestead</asp:listitem>
                                                <asp:listitem Value="Homestead_Tech">Homestead_Tech</asp:listitem>
                                                <asp:listitem Value="Personal">Personal</asp:listitem>
                                                <asp:listitem Value="Personal_HT">Personal_HT</asp:listitem>
                                                <asp:listitem Value="Personal_misc">Personal_misc</asp:listitem>
                                                <asp:listitem Value="PP_Manager">PP_Manager</asp:listitem>
                                                <asp:listitem Value="PP_Prior">PP_Prior</asp:listitem>
                                                <asp:listitem Value="TA_CI_APPR">TA_CI_APPR</asp:listitem>
                                                <asp:listitem Value="TA_CI_data_List">TA_CI_data_List</asp:listitem>
                                                <asp:listitem Value="Homestead_Tech">Homestead_Tech</asp:listitem>
                                                <asp:listitem Value="TA_CI_DE">TA_CI_DE</asp:listitem>
                                                <asp:listitem Value="TA_CI_Mgr">TA_CI_Mgr</asp:listitem>
                                                <asp:listitem Value="TA_CL_DE">TA_CL_DE</asp:listitem>
                                                <asp:listitem Value="TA_CL_FS_Admn">TA_CL_FS_Admn</asp:listitem>
                                                <asp:listitem Value="TA_CL_FS_II">TA_CL_FS_II</asp:listitem>
                                                <asp:listitem Value="TA_CL_FS_Suprv">TA_CL_FS_Suprv</asp:listitem>
                                                <asp:listitem Value="TA_RS_Appr">TA_RS_Appr</asp:listitem>
                                                <asp:listitem Value="TA_RS_Appr_Trnee">TA_RS_Appr_Trnee</asp:listitem>
                                                <asp:listitem Value="TA_RS_Mgr">TA_RS_Mgr</asp:listitem>
                                                <asp:listitem Value="TA_RS_SR_Appr">TA_RS_SR_Appr</asp:listitem>
                                                <asp:listitem Value="TIMBER">TIMBER</asp:listitem>
                                          </asp:ListBox>
                              </center>
                              <P></P>
                              &nbsp;<br>
                        </div>
                        
                        <div id="ClientServerTaxAss" class="hideme">
                              <center>
                                          <table>
                                                <tr>
                                                      <td>
                                                            <h3>Please Select The Client-Server Screen Role(s)</h3>
                                                            <asp:ListBox id="csTaxASec" runat="server" SelectionMode="Multiple" Rows="11" Width="144px">
                                                                  <asp:listitem Value="BOE">BOE</asp:listitem>
                                                                  <asp:listitem Value="C/ISYS">C/ISYS</asp:listitem>
                                                                  <asp:listitem Value="CAMAVAL">CAMAVAL</asp:listitem>
                                                                  <asp:listitem Value="DQDE">DQDE</asp:listitem>
                                                                  <asp:listitem Value="DQINQ">DQINQ</asp:listitem>
                                                                  <asp:listitem Value="HTSSYS">HTSSYS</asp:listitem>
                                                                  <asp:listitem Value="IDLIST">IDLIST</asp:listitem>
                                                                  <asp:listitem Value="PRINT">PRINT</asp:listitem>
                                                                  <asp:listitem Value="RESSYS">RESSYS</asp:listitem>
                                                                  <asp:listitem Value="TA_AA">TA_AA</asp:listitem>
                                                                  <asp:listitem Value="TA_CALP">TA_CALP</asp:listitem>
                                                                  <asp:listitem Value="TA_COST">TA_COST</asp:listitem>
                                                                  <asp:listitem Value="TA_MKT">TA_MKT</asp:listitem>
                                                                  <asp:listitem Value="TA_PP">TA_PP</asp:listitem>
                                                                  <asp:listitem Value="TA_PRINT">TA_PRINT</asp:listitem>
                                                                  <asp:listitem Value="TA_SYS">TA_SYS</asp:listitem>
                                                                  <asp:listitem Value="TA_TC">TA_TC</asp:listitem>
                                                                  <asp:listitem Value="TC_ACCT">TC_ACCT</asp:listitem>
                                                                  <asp:listitem Value="TC_SYS">TC_SYS</asp:listitem>
                                                                  <asp:listitem Value="TCWHATIF">TCWHATIF</asp:listitem>
                                                                  <asp:listitem Value="TXDE">TXDE</asp:listitem>
                                                                  <asp:listitem Value="TXINQ">TXINQ</asp:listitem>
                                                                  <asp:listitem Value="TXPUBLIC">TXPUBLIC</asp:listitem>
                                                                  <asp:listitem Value="TXSYS">TXSYS</asp:listitem>
                                                                  <asp:listitem Value="U">U</asp:listitem>
                                                            </asp:ListBox>
                                                      <td>
                                                            <h3>Please Select The Client-Server Report Role(s)</h3>
                                                            <asp:ListBox id="csTaxARep" runat="server" SelectionMode="Multiple" Rows="11" Width="144px">
                                                                  <asp:listitem Value="AAREP">AAREP</asp:listitem>
                                                                  <asp:listitem Value="BOE">BOE</asp:listitem>
                                                                  <asp:listitem Value="CAMA">CAMA</asp:listitem>
                                                                  <asp:listitem Value="COMM">COMM</asp:listitem>
                                                                  <asp:listitem Value="EXMPT">EXMPT</asp:listitem>
                                                                  <asp:listitem Value="FBOOK">FBOOK</asp:listitem>
                                                                  <asp:listitem Value="HT">HT</asp:listitem>
                                                                  <asp:listitem Value="HTADM">HTADM</asp:listitem>
                                                                  <asp:listitem Value="PP">PP</asp:listitem>
                                                                  <asp:listitem Value="PPADMN">PPADMN</asp:listitem>
                                                                  <asp:listitem Value="STATE">STATE</asp:listitem>
                                                                  <asp:listitem Value="TAADM">TAADM</asp:listitem>
                                                                  <asp:listitem Value="TAADMN">TAADMN</asp:listitem>
                                                            </asp:ListBox></td>
                                                </tr>
                                          </table>
                                    </center>
                              <P></P>
                              <br>
                        </div>
                        <div id="vpn" class="vpn">
                                    <div align="center">
                                          <table>
                                                <tr>
                                                      <td colspan="2" align="center">
                                                            <p><b><span>Virtual Private Network (VPN) Policy</span></b></p>
                                                <tr>
                                                      <td valign="top" width="150">
                                                            <b>1.0 Purpose</b>
                                                      <td><p>The purpose of this policy is to provide guidelines for Remote Access IPSec or
                                                                  L2TP Virtual Private Network (VPN) connections to the DC Government
                                                                  corporate network.</p>
                                                <tr>
                                                      <td valign="top">
                                                            <p><b>2.0 Scope</b></p>
                                                      <td>
                                                            <p><span>This policy applies to all DC Government employees, contractors,
                                                                        consultants, temporaries, and other workers including all personnel affiliated
                                                                        with third parties utilizing VPN to access the DC Government
                                                                        network. This policy applies to implementations of VPN that are directed
                                                                        through an IPSec Concentrator.</span></p>
                                                <tr>
                                                      <td valign="top">
                                                            <p><b>3.0 Policy</b></p>
                                                      <td>
                                                            <p>Approved DC Government employees and authorized third parties
                                                                  (customers, vendors, etc.) may utilize the benefits of VPN, which are a "user
                                                                  managed" service. This means that the user is responsible for selecting an
                                                                  Internet Service Provider (ISP), coordinating installation, installing any
                                                                  required software, and paying associated fees. Further details may be found in
                                                                  the <i>DC</i> <i>Remote Access Policy</i>.</p>
                                                            <p>Additionally,</p>
                                                            <table>
                                                                  <tr>
                                                                        <td valign="top" width="50"><b>3.1</b>
                                                                        <td>
                                                                  It is the responsibility of employees and personnel covered in the 2.0 scope
                                                                  statement of this policy with VPN privileges to ensure that unauthorized users
                                                                  are not allowed access to DC Government internal networks.
                                                                  <tr>
                                                                        <td valign="top"><b>3.2</b>
                                                                        <td>
                                                                  VPN use is to be controlled using radius authentication and username and
                                                                  passwords should be in compliance with the DC Government password
                                                                  policy.
                                                                  <tr>
                                                                        <td valign="top"><b>3.3</b>
                                                                        <td>When actively connected to the corporate network, the VPN concentrator will
                                                                              force all traffic to and from the PC over the VPN tunnel: all other traffic
                                                                              will be dropped.<span>&nbsp; </span>
                                                                              <P></P>
                                                                  <tr>
                                                                        <td valign="top"><b>3.4</b>
                                                                        <td>Dual (split) tunneling is NOT permitted; only one network connection is
                                                                              allowed.<span>&nbsp; </span>
                                                                              <P></P>
                                                                  <tr>
                                                                        <td valign="top"><b>3.5</b>
                                                                        <td>
                                                                  VPN gateways will be set up and managed by Dc Government network
                                                                  operational and security groups.
                                                                  <tr>
                                                                        <td valign="top"><b>3.6</b>
                                                                        <td>
                                                                  All computers connected to internal networks via VPN
                                                                  or any other technology must use the most up-to-date anti-virus software that
                                                                  is the corporate standard and ensure all windows updates are applied; this
                                                                  includes personal computers.
                                                                  <tr>
                                                                        <td valign="top"><b>3.7</b>
                                                                        <td>
                                                                  Users of computers that are not DC Government-owned equipment must
                                                                  configure the equipment to comply with DC Government's VPN and
                                                                  Network policies.
                                                                  <tr>
                                                                        <td valign="top"><b>3.8</b>
                                                                        <td>
                                                                  Only Information Security-approved VPN clients may be used.
                                                                  <tr>
                                                                        <td valign="top"><b>3.9</b>
                                                                        <td>
                                                                              By using VPN technology with personal equipment, users must understand that
                                                                              their machines are a de facto extension of DC Government's network,
                                                                              and as such are subject to the same rules and regulations that apply to Fulton
                                                                              County Government-owned equipment, i.e., their machines must be configured to
                                                                              comply with Information Security's Security Policies.</td>
                                                                  </tr>
                                                            </table>
                                                <tr>
                                                      <td valign="top"><b>4.0 Enforcement</b>
                                                      <td>
                                                Any employee found to have violated this policy may be subject to disciplinary
                                                action, up to and including termination of employment.
                                                <tr>
                                                      <td valign="top"><b>5.0 Definitions</b>
                                                      <td>
                                                            <table>
                                                                  <tr>
                                                                        <td width="150">
                                                                              <b>Term</b>
                                                                        <td><b>Definition</b>
                                                                  <tr>
                                                                        <td>
                                                                        IPSec Concentrator<td>
                                                                              A device in which VPN connections are terminated.</td>
                                                                  </tr>
                                                            </table>
                                                <tr>
                                                      <td valign="top"><b>6.0 Revision History</b>
                                                <tr>
                                                      <td>
                                                &nbsp;
                                                <tr>
                                                      <td align="right"><b>7.0 Requestor's Email</b>
                                                      <td>
                                                            <input type="text" name="VPNReqEmail" size="50">
                                                <tr>
                                                      <td>
                                                &nbsp;
                                                <tr>
                                                      <td align="right" valign="top">
                                                            <input type="checkbox" name="VPNPolicyAccept">
                                                      <td><h3><b>By checking this box the Requestor accepts the terms and conditions listed
                                                                        above.</b></h3>
                                                            
                                                <tr>
                                                      <td>
                                                &nbsp;
                                                <tr>
                                                      <td>
                                                      &nbsp;<td>
                                                            A copy of the VPN Policies and VPN Request Form will be emailed to the
                                                            Requestor and Authorized Requestor upon submision of this form.</td>
                                                </tr>
                                          </table>
                                    </div>
                        </div>

                  </asp:View>
                  <asp:View ID="View3" runat="server">
                        <table cellpadding="4" cellspacing="4">
                              <tr>
                                    <td colspan="2"><b>Summary</b></td>
                              </tr>
                              <tr>
                                    <td>Serive Type:</td>
                                    <td><asp:Label ID="lblName" runat="server" /></td>
                              </tr>
                              <tr>
                                    <td>Copied:</td>
                                    <td><asp:Label ID="lblSurname" runat="server" /></td>
                              </tr>
                              <tr>
                                    <td>Name:</td>
                                    <td nowrap><asp:Label ID="lblAge" runat="server" Width="40" /></td>
                              </tr>                              
                              <tr>
                                    <td>Job Title:</td>
                                    <td><asp:Label ID="lblPhone" runat="server" /></td>
                              </tr>
                              <tr>
                                    <td>Phone:</td>
                                    <td><asp:Label ID="lblEmail" runat="server" /></td>
                              </tr>
                              <tr>
                                    <td>Email:</td>
                                    <td><asp:Label ID="lblIcq" runat="server" /></td>
                              </tr>
                        </table>                  
                  </asp:View>
            </asp:MultiView>
            <asp:label id="lblStatus" runat="server" Text="" ForeColor="#FF8000" Font-Bold="True" Font-Names="Garamond"></asp:label>
            <asp:Button ID="btnBack" runat="server" Text="&lt; Back " OnClick="btnBack_Click" />
            <asp:Button ID="btnNext" runat="server" Text="Continue &gt;&gt;" OnClick="btnNext_Click" />      
            <asp:Button ID="btnSend" runat="server" Text="Send" OnClick="btnSend_Click" />
      </div>
      </form>
            </td>
         </tr>
        </table>
      </div>
</body>
</html>

Christopher KileSenior Software Analyst
CERTIFIED EXPERT

Commented:
You have a bit of mangled HTML in your first view:

                                    <p align="left"><font color="#000080" size="6">
                                                      <center><u>ACCESS FORM</u></center>
                                                </font><font size="4"><p>

should be

                                    <p align="left"><font color="#000080" size="6">
                                                      <center><u>ACCESS FORM</u></center>
                                                </font><p>

as this font tag is never closed.  This may prevent the inner HTML of this view from being compiled, but the proper closure on the view itself isolates the problem to this view and, I believe, prevents it from being added to the list of available views.  Thus, view 0 is what you believe to be your second view, but because the first view didn't parse the second view is the first view that parsed and is now view 0.

Make the fix and see if it works, then please let me know.

Author

Commented:
thank you for your kindness.

I did as you instructed but I still get that documents.forms.0.txtservice is null or not an object.
Christopher KileSenior Software Analyst
CERTIFIED EXPERT

Commented:
Well, it's not.  In my HTML, txtservice renders as a table, and none of your document.form[0] references work.  It's going to take me a bit to rewrite your code into something workable - have patience, I'll get back to you.
Senior Software Analyst
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Christopher KileSenior Software Analyst
CERTIFIED EXPERT

Commented:
The reason for the previous code is this:  
a CheckBoxList is formatted into a table, with the rows built apparently just to support the display format; each cell of the table,

however, contains an input=checkbox control as well as a label associated with that checkbox; the label contains the text displayed as the label of the checkbox (e.g. "VPN");

if one uses document.getElementsByTagName() to get all the labels, then iterates through them looking for the label with inner text (the displayed text) set to the option you're interested in (e.g. "VPN"), the only available child control of the label's parent control is the checkbox associated with that label (for some reason, the label does not itself appear in the child control list).

One possible change that I would add to the previous code would be to pass in the id of the checkbox list from which I want the checkbox the id of which is passed in the second parameter, which helps to document which list is being used (the id of the checkbox still has to be unique among the ids used in the document):

function load(){

var getChoice = function (cbList, s) {
      var labels = document.getElementsByTagName("label")

      for (var i = 0; i < labels.length - 1; i++) {
            if (labels[i].innerText == s) {
                  debugger;
                  var tblTag = new String(labels[i].parentNode.parentNode.parentNode.parentNode.tagName);
                  var tblID = new String(labels[i].parentNode.parentNode.parentNode.parentNode.id);
                  var targetList = new String(cbList);
                  if (tblTag.toLowerCase() == "table" && tblID.toLowerCase() == targetList.toLowerCase())
                        return labels[i].parentNode.childNodes[0];
            }
      }
}


if (getChoice("txtservice", "VPN").checked){
    document.getElementById("vpn").style.visiblilty="visible";
    document.getElementById("vpn").style.display="block";
     
}
if (getChoice("txtservice", "iasWorld").checked){
        document.getElementById("iasConnType").style.visiblilty="visible";
        document.getElementById("iasConnType").style.display="block";
}
... // rest of load function

I tested this personally and it works like a champ.  

Now, as to AgencyName...I note that this value only appears in your second View.  Are any of its values defined and accesible when the first view is active?  I'm just not sure, but assuming that it is so does not seem wise to me.

Have you had a chance to try this yet?

Author

Commented:
Thank you so so very much.

I have been blessed to run into experts like you are willing to sacrifice their times to assist someone they don't know. I thank you so much.

I also want to apologize because it took me this time to respond. Please understand that as I desparate as I am for solution, the only I am responding late is due to reasons beyond my control. Otherwise, I would have glued myself to the pc until I hear from you. So, sorry.

Having said that, I am having a different issue with the js.

First, I am getting an error about the debugger on this line:


      for (var i = 0; i < labels.length - 1; i++) {
            if (labels[i].innerText == s) {
                  debugger;

I commented out debugger as in //debugger; and now I get an error that checked is null or not an object.

The checked referenced is these lines:

if (getChoice("txtservice", "VPN").checked){

and

if (getChoice("txtservice", "iasWorld").checked){

I most grateful for your assistance.

Also, notice that body has an onload event handler like:

<body onload="load();">

Is that still valid?

Finally, with reference to agencyName function, another wonderful guy by the name of Tim Cottee, helped with the agencyName() function

and the call to the function was made in the page_load() event handler.

The function:

function agencyChange(an){
      if (an.value != "Tax Assessor"){
            document.getElementById("iasWorldTaxAss").style.visiblilty="hidden";
            document.getElementById("iasWorldTaxAss").style.display="none";
            document.getElementById("ClientServerTaxAss").style.visiblilty="hidden";
            document.getElementById("ClientServerTaxAss").style.display="none";
      }
}

the call to the function:

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
        AgencyName.Attributes.Add("onchange", "agencyChange(this);")
    End Sub

That's the code he gave. I believe it works fine.

I hope I answered that agencyName questions.

Thank you, thank you, thank you
Christopher KileSenior Software Analyst
CERTIFIED EXPERT

Commented:
Re: forms[0].AgencyName...OK, I'll quit asking about that form of reference until you run into another problem with it.

Now, here's an issue:  I'm running VS 2003 on my work machine, so the Javascript generated by my ASP.NET controls may be different from yours.  When I did a View Source on my page, I saw a table with id="txtservice", each cell of which had an input type=checkbox with ids of "txtservice_<0 to number of checkboxes in control - 1>", followed by a label assigned to that checkbox, the text value of which can be examined (you can see this working in the code I sent you).

Here's what I would like you to do: take the code for your first view and place it in its own page;  browse to this page then get the source for it from the client browser (in IE, right-click on the page then select View Source); text search for "txtservice" from the top of the source, until you find the control the exact id of which IS "txtservice";  send me everything from the start tag of that control through the end tag of that control from the client source.  This will tell me how the control in your version is translated into HTML and Javascript, and will thus tell me how to get the information you need.

Once each of your views are working correctly as single pages, we can then put the modified view in place and test the page again.

Author

Commented:
Ok, I am doing that now.

I just wanted to mention, that I am using Visual Developer 2005 Express Edition. That may have something to do with it.

I have VS 2003 myself but I was told that MultiView class won't work with it.

I tried anyway but ran into trouble and decided to download the VS 2005 express edition.

I don't know what you did to make it work on your VS 2003.
Christopher KileSenior Software Analyst
CERTIFIED EXPERT

Commented:
I didn't make Multiview work.  I worked from basic principles:  if a set of components doesn't work in standalone fashion, it won't work when added as children of a container.  I tested your controls in the first view as a standalone page, and they did not work.  With your help, we'll get them working.

By the way, the only thing Multiview seems to do is encapsulated the visibility and availability of distinct groups of controls, which is something I have done in NET 1.1 w/o MultiView (indeed, I did it in MSDOS 3.1 using cruder technology but the same idea).  I will state that controlling visibility over a group of controls can take a LOT of code, so the Multiview saves that at the very least.

Author

Commented:
Ok, I created a standalone page and tested the txtservice functionality.

First, if I uncomment the degugger; syntax you put in there, it automatically opens the degugger and points to debugger;

However, if I comment it out, I get no errors at all but it is hard to tell whether or not it is working because if you recall, if you check vpn, it is supposed to open vpn page.

Here is the html source code;



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1"><title>
      Service Request Form
</title>
      <style type="text/css">
            body { font-family: arial; font-size: 10pt; }
            table { background-color: #eeeeee; margin-bottom: 10px; }
      </style>
<style type="text/css">
<!--
.vpn  {display:none;}
.hideme {display:none;}
-->
</style>


<script Language="JavaScript" Type="text/javascript"><!--

function load(){

var getChoice = function (cbList, s) {
      var labels = document.getElementsByTagName("label")

      for (var i = 0; i < labels.length - 1; i++) {
            if (labels[i].innerText == s) {
                 // debugger;
                  var tblTag = new String(labels[i].parentNode.parentNode.parentNode.parentNode.tagName);
                  var tblID = new String(labels[i].parentNode.parentNode.parentNode.parentNode.id);
                  var targetList = new String(cbList);
                  if (tblTag.toLowerCase() == "table" && tblID.toLowerCase() == targetList.toLowerCase())
                        return labels[i].parentNode.childNodes[0];
            }
      }
}


if (getChoice("txtservice", "VPN").checked){
    document.getElementById("vpn").style.visiblilty="visible";
    document.getElementById("vpn").style.display="block";
     
}
if (getChoice("txtservice", "iasWorld").checked){
        document.getElementById("iasConnType").style.visiblilty="visible";
        document.getElementById("iasConnType").style.display="block";
}
}

//--></script>


</head>
<body onload="load()">

            <div align="center">
                  <table borderColor="black" cellSpacing="0" cellPadding="0" border="1">
                        <tr>
                              <td><IMG height="75" src="images/home_top_01.jpg" width="100" border="0"><IMG height="75" src="images/home_top_02.jpg" width="314" border="0"><IMG height="75" src="images/home_top_03.jpg" width="330" border="0">
                                    
                                    <br>
                                                <p align="left"><font color="#000080" size="6">
                                                      <center><u>USER ACCESS FORM</u></center>
                                                </font></p>

                                                            
                                                            <font color="#ff0000" size="4"><i>All Boxes with * must be Completed</i></font>
                                                            &nbsp;&nbsp;&nbsp;<font size="2"></font>-
                                                            <script language="javascript" src="js/liveclock_lite.js"></script>
                                                
                                     <center><img src="images/lines.jpg" border="0"></center>

      <form name="cform" method="post" action="tester.aspx" id="cform">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTcwMzIwMzQ2NmQYAQUeX19Db250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFhEFDHR4dHNlcnZpY2UkMAUMdHh0c2VydmljZSQxBQx0eHRzZXJ2aWNlJDIFDHR4dHNlcnZpY2UkMwUMdHh0c2VydmljZSQ0BQx0eHRzZXJ2aWNlJDUFDHR4dHNlcnZpY2UkNgUMdHh0c2VydmljZSQ3BQx0eHRzZXJ2aWNlJDgFDHR4dHNlcnZpY2UkOQUNdHh0c2VydmljZSQxMAUNdHh0c2VydmljZSQxMQUNdHh0c2VydmljZSQxMQUKdHh0Q2hlY2skMAUKdHh0Q2hlY2skMQUKdHh0Q2hlY2skMgUKdHh0Q2hlY2skMgxlKlj6rfIAZnJUqLmS2eMbI6mt" />
</div>


            
             <font color="#ff0000">Please Specify the Connection (s) and/or Application (s) by checking the appropriate box</font>
                                                <table cellSpacing="0" cellPadding="4" width="100%" border="0">
                                                      <tr>
                                                            <td nowrap align="center" style="width: 61%">

                                                                        <table id="txtservice" border="0">
      <tr>
            <td><input id="txtservice_0" type="checkbox" name="txtservice$0" /><label for="txtservice_0">Seagull</label></td><td><input id="txtservice_1" type="checkbox" name="txtservice$1" /><label for="txtservice_1">Email</label></td><td><input id="txtservice_2" type="checkbox" name="txtservice$2" /><label for="txtservice_2">Mainframe</label></td><td><input id="txtservice_3" type="checkbox" name="txtservice$3" /><label for="txtservice_3">Cubis</label></td><td><input id="txtservice_4" type="checkbox" name="txtservice$4" /><label for="txtservice_4">Banner</label></td><td><input id="txtservice_5" type="checkbox" name="txtservice$5" /><label for="txtservice_5">JDL</label></td>
      </tr><tr>
            <td><input id="txtservice_6" type="checkbox" name="txtservice$6" /><label for="txtservice_6">OTiburon</label></td><td><input id="txtservice_7" type="checkbox" name="txtservice$7" /><label for="txtservice_7">iasWorld</label></td><td><input id="txtservice_8" type="checkbox" name="txtservice$8" /><label for="txtservice_8">Notary</label></td><td><input id="txtservice_9" type="checkbox" name="txtservice$9" /><label for="txtservice_9">VPN</label></td><td><input id="txtservice_10" type="checkbox" name="txtservice$10" /><label for="txtservice_10">VPS-Pagecenter</label></td><td><input id="txtservice_11" type="checkbox" name="txtservice$11" /><label for="txtservice_11">PC DOC</label></td>
      </tr>
</table>
                                                                        <table id="txtCheck" border="0">
      <tr>
            <td><input id="txtCheck_0" type="checkbox" name="txtCheck$0" /><label for="txtCheck_0">GHRS</label></td><td><input id="txtCheck_1" type="checkbox" name="txtCheck$1" /><label for="txtCheck_1">OASIS</label></td><td><input id="txtCheck_2" type="checkbox" name="txtCheck$2" /><label for="txtCheck_2">CAMA</label></td>
      </tr>
</table>
                                                            </td>
                                                      </tr>
                                                </table>



            <span id="lblStatus" style="color:#FF8000;font-family:Garamond;font-weight:bold;"></span>
      
<div>

      <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWEALixIfdCgKmpLbIBAKmpMqjDQKmpN7+BQKmpPLZDgKmpIa1BwKmpJoQAqakrusIAqakwsYBAqak1qEKAqak6vwCAuqSh/sJAumSh/sJAv3m14cBAv3m04cBAv3m34cBHODUVEfG3GBNt3jMWC5B4TkRxIo=" />
</div></form>
            </td>
         </tr>
        </table>
      </div>
</body>
</html>
Christopher KileSenior Software Analyst
CERTIFIED EXPERT

Commented:
Excellent, the HTML structure of the CheckBoxList is identical except for the Name convention (the previous version used colon (:) instead of American dollar sign ($) as the delimiter between the list name and the item number).

As for testing this, I note that you would have to have navigation functions in place to change the current View of the Multiview - building stubs for those functions containing nothing but

alert("<function name>");

would make you ready for when the HTML is placed back into the View.  

Ummmm, I just found something that might be troublesome:  the ActiveViewIndex of the Multiview determines which view is RENDERED to the client, thus any other Views (and their child controls) will NOT be rendered if they are not in the active View.  Thus, only controls in the active view and those defined outside the MultiView can be referenced in the Javascript; also, in order to change the active View, you have to post the page back to the server, change the ActiveViewIndex, then get the fresh page from the server with the new View in place.

Up to this point, I thought a pure Javascript solution might be possible, but now I doubt it very much.  Is it an actual technical requirement that you use a Multiview for this project, or is this an exploration of one method for meeting a particular functional requirement?  I ask because, if I understand the intent of your code correctly, you may be better served by a more client-based approach.

Author

Commented:
First, I want to thank you again for your continued assistance and patience.

Your question:

>>Is it an actual technical requirement that you use a Multiview for this project, or is this an exploration >>of one method for meeting a particular functional requirement?

No, it is not a technical requirement. The issue here we have the same app running in classic asp but they want me to convert that version to .net.

The reason this is such a pain is because there are 2 pages.

The first page contains txtservice with values shown in my previous posts, txtCheck, also a checkbox, authorized firstname, authorized last name, phone and email address.

Then when you click Next or my own case the Continue>> button, then you are taken to the second page where additional information is gathered.

Then both values from first and second pages are passed to process page or codeBehind file and submitted to the db.

The primary reason for using Multiview is because I could not figure out a way to go from page to page.

Now, that I was able to do that with Multiview, javascript is an issue and the reason Javascript is used here is so that if you check the VPN option, you see instructions on what to do with vpn but if you don't check vpn, you just go ahead and process page 2 and submit your records.

So, 2 major issues here,
1, navigating from page to page and passing values along and finally processing and submitting records in codeBehind
2, Making sure that if a user checks the vpn checkbox, and click Continue>> they complete next page plus see vpn instructions.

If I can do any other way, that would be great.

My biggest issue is that I am newbie to .net.
Christopher KileSenior Software Analyst
CERTIFIED EXPERT

Commented:
:) I was correct in my analysis, then.  First, the good news:  you don't necessarily need new pages, unless you need to make a round trip to the server to get new information.

Divide all the controls that are on the two pages into three categories:

1.  Controls that appear in the same location on both pages.
2.  Controls that appear only on the first page.
3.  Controls that appear only on the second page.

Now, the following example shows how have two controls occupy the same space at the same time using MS_POSITIONING="GridLayout" and the style attributes pixelLeft.  Note that text2 and button2 are positioned well to the negative of 0 at the start so that none of the hidden controls can be seen, and watch the interval counter swap them from visibility to invisibility, back and forth.  Study it carefully, and try to understand how it works.  When you're done, write back to me:

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="WebApplication2.WebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
      <HEAD>
            <title>WebForm1</title>
            <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
            <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
            <meta name="vs_defaultClientScript" content="JavaScript">
            <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
      </HEAD>
      <body MS_POSITIONING="GridLayout">
            <form id="Form1" method="post" runat="server">
                  &nbsp;&nbsp;
                  <br>
                  <INPUT id="button1" style="Z-INDEX: 102; LEFT: 184px; WIDTH: 48px; POSITION: absolute; TOP: 8px; HEIGHT: 24px; BACKGROUND-COLOR: yellow"
                        type="button" value="Button">
                  <INPUT id="button2" style="Z-INDEX: 104; LEFT: -235px; WIDTH: 48px; POSITION: absolute; TOP: 8px; HEIGHT: 24px; BACKGROUND-COLOR: aqua"
                        type="button" value="Button">
                  <INPUT id="text1" style="Z-INDEX: 105; LEFT: 8px; WIDTH: 168px; POSITION: absolute; TOP: 8px; HEIGHT: 24px; BACKGROUND-COLOR: yellow"
                        type="text" size="22">
                  <INPUT id="text2" style="Z-INDEX: 106; LEFT: -183px; WIDTH: 168px; POSITION: absolute; TOP: 8px; HEIGHT: 24px; BACKGROUND-COLOR: aqua"
                        type="text" size="22">
                  <script type="text/javascript" language="javascript">
                  // <!--
                        
                        var switchCount = 0;
                        var text1 = document.getElementById("text1");
                        var text2 = document.getElementById("text2");
                        var button1 = document.getElementById("button1");
                        var switchValue = switchCount % 2;
                        var switchOne = switchCount % 2 == 0;
                        var switchTwo = !switchOne;
                        
                        var button2 = document.getElementById("button2");
                        
                        function switch_locations() {
                              switchCount++;
                              switchValue = switchCount % 2;
                              switchOne = switchCount % 2 == 0;
                              switchTwo = !switchOne;
                              var swapLeft = text1.style.pixelLeft;
                              
                              text1.disabled = !switchOne
                              text1.style.pixelLeft = text2.style.pixelLeft
                              
                              text2.disabled = !switchTwo
                              text2.style.pixelLeft = swapLeft;
                              
                              swapLeft = button1.style.pixelLeft;
                              button1.disabled = !switchOne;
                              button1.style.pixelLeft = button2.style.pixelLeft
                              
                              button2.disabled = !switchTwo
                              button2.style.pixelLeft = swapLeft;
                        }

                        text2.disabled = true;
                        
                        button2.disabled = true;
                              
                        
                        window.setInterval("switch_locations()", 5000);
                  // -->
                  </script>
            </form>
      </body>
</HTML>
Christopher KileSenior Software Analyst
CERTIFIED EXPERT

Commented:
Once you've studied that example, you may continue with:

4.  Figure out the exact absolute position each control should be at when visible, and when invisible.  Build a table of these values:

var tableOfLefts;
tableOfLefts["txtService"]["visible"] = <left value when visible as integer>;
tableOfLefts["txtService"]["invisible"] = <left value when invisible as integer>;

Then, assign the appropriate value to style.pixelLeft:

// make txtservice visible
document.getElementById("txtservice").style.pixelLeft = tableOfLefts["txtservice"]["visible"];

Get the idea?

Author

Commented:
ok, just got back to this now.

I will spend a good amount of time studying and I wil back to you.

You have been a blessing, thank you very much

Author

Commented:
one more thing, can I get back to vs 2003 now that i am changing the way we are doing it?
Christopher KileSenior Software Analyst
CERTIFIED EXPERT

Commented:
Yes :)  This approach is perfectly suitable for VS 2003.

The idea behind this approach is to move controls that shouldn't be visible out of view.  Interestingly, negative coordinates for style.pixelLeft and style.pixelTop will position a control partially or wholly offscreen.  The value I choose for pixelLeft must make the control completely visible in the position we like it, or it must make it completely invisible (wholly offscreen) by pushing it far enough to the left so that not even the right edge of the control is visible.  If you then set .disable to true, the control is completely inaccessible until you move it back into visibility and set .disabled back to true.

Author

Commented:
cpkilekofp,

I am still studying your code trying to make some sense out it.

But when I tested the code you posted, I noticed each button click was switching the color alternately between yellow and aqua.

I am a bit slow but how do I apply this to 2 components.

From page1 to page2, and then displaying instructions when vpn is clicked on the checkboxlist control?

What is really bothering me is that this was much easier to implement with classic asp than it is with .net .

Logic dictates the other way round.

I am so frustrated with it that I am about to close this thread.

You have given me a whole lot more than I could have asked for...thank you very, very much but each new approach becomes more and more cumbersome to me, SIGH!!
Christopher KileSenior Software Analyst
CERTIFIED EXPERT

Commented:
Hmmmm....look, you've said you're inexperienced with ASP.NET.  Coming from simple ASP, a lot of assumptions you might make about processing are pointlessly wrong.  Once you pass the largest part of the learning curve, you begin to see how powerful ASP.NET can be...but that doesn't mean it's "easier" that ASP, even though it does mean you can do things with ASP.NET that were difficult or impossible to do in ASP.

For instance, you don't seem to understand the ASP.NET processing cycle.  Most processing in a typical ASP.NET application takes place on the server - you set up an event handler (for instance, a handler to deal with a button click) in server code; when you click the button, the page posts to the server, and the server handler modifies the controls being passed back to the client to reflect the changes.  You can do this with a checkbox control as well (I do so in at least one of the apps I maintain).

To implement my all-Javascript all-client solution, every control on your page must be assigned an absolute position.  This is easily done by setting your form to GridLayout (a modification to the <body> tag, see my previous posts) then move the control away from its current postion then back to where you like it; switching back from Design view to HTML view then causes the Style setting for the control to now include "POSITION: absolute;  LEFT:  <left value>; TOP: <top value>".   To make a control invisible, assign its .style.pixelLeft a large negative value; to make it visibile, restore its correct .style.pixelLeft position.  The table-driven approach I suggested in my previous post provides a simple way to do it.  However, an all-client solution is not the only way to go.

You're in over your head, that's apparent, but I can keep you floating and swimming until you get to land (a successfully implemented page).  DON'T LET YOURSELF DROWN.  Please.

Author

Commented:
what a guyI

People like you don't come around that often.

Thank you very much for your support!

You are really great!!
Christopher KileSenior Software Analyst
CERTIFIED EXPERT

Commented:
Thanks :)  

One comment:  The controls aren't changing color from aqua to yellow.  The controls aren't changing color at all.  The aqua control is being moved to invisibility and the yellow control is being moved into visibility, then on the next interval this is reversed.  Run the code in the debugger (insert the statement

debugger;

and it will pop into the debugger when it reaches this, use <F10> and <F11> to step through the code, to examine a control and its contents right-click a variable containing the control then Add Watch).
Christopher KileSenior Software Analyst
CERTIFIED EXPERT

Commented:
BTW, any control contained within a table cell will move with the table (unless its style specifies "POSITION: absolute") so you should be able to move the entire table in and out of visibility with one line of code:  tbl.style.pixelLeft = <visibility or invisibility left coordinate).

Author

Commented:
ok,

I am playing with it. I will post when done.

You have surprised me in a very happy way with your patience, excellent assistance and inspiration.

Thank you so much. There is no way 100 points will adequately express my level appreciation for all you have done for me so far.

Thanks a million!
Christopher KileSenior Software Analyst
CERTIFIED EXPERT

Commented:
You're welcome :)  I'm still here if a problem comes up.

Author

Commented:
Thank you so so much for your assistance and patience with this.

I am still struggling a bit but much closer to solving it.

I will post the complete solution when done.

It just doesn't feel right to leave this thread open simply because I am not done yet.

You have beena tremendous help. Thank you!
Christopher KileSenior Software Analyst
CERTIFIED EXPERT

Commented:
You are quite welcome, and please don't hesitate to post back here for short questions or to let me know that you've started another thread with more extensive questions on this same project.  

Author

Commented:
I have it WORKING!!!!!!!!!!!

Your comments here:

The reason for the previous code is this:  
a CheckBoxList is formatted into a table, with the rows built apparently just to support the display format; each cell of the table,

however, contains an input=checkbox control as well as a label associated with that checkbox; the label contains the text displayed as the label of the checkbox (e.g. "VPN");

if one uses document.getElementsByTagName() to get all the labels, then iterates through them looking for the label with inner text (the displayed text) set to the option you're interested in (e.g. "VPN"), the only available child control of the label's parent control is the checkbox associated with that label (for some reason, the label does not itself appear in the child control list).

One possible change that I would add to the previous code would be to pass in the id of the checkbox list from which I want the checkbox the id of which is passed in the second parameter, which helps to document which list is being used (the id of the checkbox still has to be unique among the ids used in the document):

is shared by someone else I showed my code. The guy gave me an excellent suggestion, again the suggestion is in line with yours except that the code was written differently.

First, I wrote a js function that collects all of the checked service checkboxes and
 puts the comma-space-delimited value into the hidden service form field
the hidden field is then inserted into side <form>...</form>

as

<asp:HiddenField ID="service" runat=server />

But before that, I had to identify the view that the service is in since there are 3 views and again inserted that view as hidden field inside the form tag with value of the view which is 1:
<asp:HiddenField ID="currentView" runat=server value="1" />

Then each process references them.

This seemed to have worked.


Here is the js code:
function loadservice( )
{
  // the hidden field is supposed to tell us which view (1,2,3) is showing
  // the checkboxes are only present in view 1, so...
  if ( document.cform.currentView.value != "1" ) return;

  var tsDiv = document.getElementById("trService");
  if ( tsDiv == null ) return; // this should never happen if view is 1???

  // let's get the list of checked cbService checkboxes right here:
  var tsChecked = "";
  var ts = tsDiv.getElementsByTagName("INPUT"); // will actully be only the TRs
  if ( ts != null ) /* how could it ever be null??? well...caution */
  {
      for ( var tix = 0; tix < ts.length; ++tix )
      {
          if ( ts[tix].checked ) tsChecked += ", " + ts[tix].value;
      }
  }
  document.cform.service.value = tsChecked.substring(2); // lop off the leading comma-space
}

Then function loadservice is invoked when checking for whether vpn was selected or not.

I want to use this opportunity again to thank you for your tremendous, unflinching assistance, your words of encouragement with this issue. Your comments, codes, eventually provided the model for solving this problem.

All I am looking for now is email code that I need to integrate with the codebehind so that when data is submitted to the db, an email blast goes out to certain recipients, including the individual making the request.

If you know where I can get a working sample that interacts with the db, I will of course be much appreciated.

Otherwise, I will continue to play with it till I get  it.

At least now, management can see progress, and then give me more time to complete this project.

Thanks a lot again.
Christopher KileSenior Software Analyst
CERTIFIED EXPERT

Commented:
This function uses the Simple Mail Transport Protocol (SMTP) server that is resident on any machine with IIS installed:

        Private Sub sendEmailMessage(ByVal strMessage As String, ByVal subj As String, ByVal mailTo As String)

            Try
                Dim mail As New MailMessage
                If (Len(strMessage) > 0) Then
                    SmtpMail.SmtpServer = "127.0.0.1"  'Always the local machine
                    mail.From = "<Fill in your From address here>"
                    mail.To = mailTo
                    mail.Subject = subj
                    mail.Body = strMessage
                    mail.BodyFormat = MailFormat.Text
                    SmtpMail.Send(mail)
                End If
            Catch ex As System.Exception
                evl.WriteEntry("StatusAcquisition.sendEmailMessage('" & strMessage & "', '" & subj & "', '" & mailTo & "): " & ex.ToString, EventLogEntryType.Error)
            End Try
        End Sub




Now, mailTo can have multiple addresses in it (separate them with semicolons (;)) but this does not always work when testing from an XP development workstation.

Author

Commented:
oh wow, what a guy!!!

You have already supplied the code.

First, all I just need is the insert this code in codefile. Doesn't it need to be called by the function that submits data to the db?

Thanks a million!!
Christopher KileSenior Software Analyst
CERTIFIED EXPERT

Commented:
Yes, it does need to be called by the function that submits data to the db.  I recommend that you call it immediately after a data submission.  You might want to have a different mail go out if there is an error, or possibly more than one (one to the requester telling him there was an error, a second to you or to Tech Support giving the full error information) while in the case of success you simply send an email to your requester informing him of the successful submission.

Author

Commented:
Thank you very much.

If it begins to give me trouble and it starts to take  long, I will open a new thread for it.

Once again, I am truly grateful for everything.
Christopher KileSenior Software Analyst
CERTIFIED EXPERT

Commented:
you're very welcome :)

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.