D
dmiller23462
I'm trying to create a submission page for users to request PC/LAN
Access....If they select "Yes" in the field asking about if they need
Non Standard Software, I want several other HTML fields to become
visible....If they keep the dropdown box at "No" (default) then I want
to submit the form "as is", keeping the inapplicable HTML fields
hidden....I'm trying an "if statement" in ASP....Here's my code....I'm
thinking that the if statement may be in the wrong place in the
code....I would like it to display as soon as the selection is
switched to "Yes"...The if statement that I entered has been commented
for your convenience....
********Code Begins*******
<html>
<head>
<title>Comments</title>
</head>
<!-- #INCLUDE VIRTUAL="/_borders/top_nav.asp" -->
<% if mode <> "Send" then %>
<p> </p>
<p>This is a template page that will email to certain
parties and then also append to a file all information submitted
online</p>
<form method="POST" action="PC-Lan-Rqst.asp"
name="pclanrqstname" onSubmit="validate()">
<div align="left">
<table border="0" cellpadding="0" width="782">
<tr>
<td width="243">Full Name:</td>
<td width="529"><input type="text" name="name"
size="32"></td>
</tr>
<tr>
<td width="243">Title.:</td>
<td width="529"><input type="text" name="title"
size="32"></td>
</tr>
<tr>
<td width="243">Extension:</td>
<td width="529"><input type="text" name="ext"
size="20"></td>
</tr>
<tr>
<td width="243">Department:</td>
<td width="529"><input type="text" name="dept"
size="20"></td>
</tr>
<tr>
<td width="243">Location:</td>
<td width="529"><input type="text" name="loc"
size="20"></td>
</tr>
<tr>
<td width="243">Requestor's Name:</td>
<td width="529"><input type="text" name="rqstrname"
size="33"></td>
</tr>
<tr>
<td width="243">Dept Head's Name:</td>
<td width="529"><input type="text" name="depthdname"
size="33"></td>
</tr>
<tr>
<td width="243">Start Date (if new hire):</td>
<td width="529"><input type="text" name="strtdate"
size="20"></td>
</tr>
<tr>
<td width="243">Assignment Dates (if temp
employee):</td>
<td width="529"><input type="text" name="tempdates"
size="20"></td>
</tr>
<tr>
<td width="243">Standard Hardware</td>
<td><select size="1" name="stdrdhdwre">
<option selected>Personal Printer</option>
<option>Network Printer</option>
</select></td>
</tr>
<tr>
<td width="243"><u>Standard</u> Software:</td>
<td width="529">Microsoft Word * Microsoft Excel *
Microsoft
Access * Microsoft PowerPoint * GroupWise/Internet
E-Mail * SAP
* IBM Emulation * Anti Virus</td>
</tr>
<tr>
<td width="243">Non Standard Software?</td>
<td width="529"><select size="1"
name="nstandswoption">
<option selected>No</option>
<option>Yes (See Below)</option>
</select></td>
</tr>
<% 'THIS IS THE LINE THAT I HAVE ENTERED
If nstandswoption = "Yes" Then
%>
<tr>
<td width="243">Non Standard Software:</td>
<td width="529"><input type="text"
name="nstandsoftware" size="20"></td>
</tr>
<tr>
<td width="772" colspan="2">
<p align="center"><b>Department Cost Center
Information<br>
(required only if you are requesting non-standard
hardware or
software)</b></td>
</tr>
<tr>
<td width="243">:Cost Center:</td>
<td width="529"><input type="text" name="costcenter"
size="20"></td>
</tr>
<tr>
<td width="243">:G/L Number:</td>
<td width="529"><input type="text" name="glnumber"
size="20"></td>
</tr>
<tr>
<td width="772" colspan="2">
<p align="center"><b>Network Directory Access</b></td>
</tr>
<tr>
<td width="243">Dept Directory Name:</td>
<td width="529"><input type="text" name="deptdirname"
size="20"></td>
</tr>
<tr>
<td width="243">Other:</td>
<td width="529"><input type="text" name="other"
size="20"></td>
</tr>
<tr>
<td width="772" colspan="2">
<p align="center"><b>GroupWise Public Groups</b></td>
</tr>
<tr>
<td width="243">Add to (Group Name):</td>
<td width="529"><input type="text" name="addgroup"
size="20"></td>
</tr>
<tr>
<td width="243">Remove from (Group Name):</td>
<td width="529"><input type="text" name="removegroup"
size="20"></td>
</tr>
<tr>
<td width="243" valign="top">Justification for
Non-Standard
Hardware and Software:</td>
<td width="529"><textarea rows="7"
name="justification" cols="43"></textarea></td>
</tr>
<%
End if
%>
<tr>
<td width="243" valign="top"> </td>
<td width="529"> </td>
</tr>
<tr>
<td width="243" valign="top"> </td>
<td width="529">
<input type="submit" value="Send Message"
name="Send"></td>
</tr>
</table>
</div>
<input type="hidden" name="mode" value="Send">
</form>
<script language="vbscript">
sub validate()
if trim(len(document.suggest.from.value)) = 0 then
msg = "Please note that you must provide your name" & vbcrlf & "if
you'd like to hear back from us for your suggestions..." & vbcrlf &
vbcrlf & "Continue to send this anonymously?"
if msgbox(msg, vbYesNo, "Please wait!") <> 1 then
window.event.returnvalue = false
document.suggest.from.focus()
exit sub
end if
end if
end sub
</script>
<% end if
if mode = "Send" and Err = 0 then
%>
<h2> </h2>
<p><img border="0" src="../images/success.jpg"></p>
<p>The following information has been successfully submitted</p>
<p>Name : <font color="#0000FF"> <%=name%></font><br>
Title : <font color="#0000FF"> <%=title%></font><br>
Ext.: <font color="#0000FF"> <%=ext%></font><br>
Department : <font color="#0000FF"> <%=dept%></font><br>
Location : <font color="#0000FF"> <%=loc%></font><br>
Requestor Name : <font color="#0000FF"> <%=rqstrname%></font><br>
Dept Head Name : <font color="#0000FF"> <%=depthdname%></font><br>
Start Date : <font color="#0000FF"> <%=strdate%></font><br>
Assignment Dates (Temp) : <font color="#0000FF">
<%=tempdates%></font><br>
Standard Hardware : <font color="#0000FF"> <%=stdrdhdwre%></font><br>
Non-Standard Software : <font color="#0000FF">
<%=nstandsoftware%></font><br>
Cost Center : <font color="#0000FF"> <%=costcenter%></font><br>
GL Number : <font color="#0000FF"> <%=glnumber%></font><br>
Dept Director's Name : <font color="#0000FF">
<%=deptdirname%></font><br>
Other : <font color="#0000FF"> <%=other%></font><br>
Add to Group : <font color="#0000FF"> <%=addgroup%></font><br>
Remove from Group : <font color="#0000FF"> <%=removegroup%></font><br>
Justification : <font color="#0000FF"> <%=justification%></font><br>
<%
end if
********End of Code********
Access....If they select "Yes" in the field asking about if they need
Non Standard Software, I want several other HTML fields to become
visible....If they keep the dropdown box at "No" (default) then I want
to submit the form "as is", keeping the inapplicable HTML fields
hidden....I'm trying an "if statement" in ASP....Here's my code....I'm
thinking that the if statement may be in the wrong place in the
code....I would like it to display as soon as the selection is
switched to "Yes"...The if statement that I entered has been commented
for your convenience....
********Code Begins*******
<html>
<head>
<title>Comments</title>
</head>
<!-- #INCLUDE VIRTUAL="/_borders/top_nav.asp" -->
<% if mode <> "Send" then %>
<p> </p>
<p>This is a template page that will email to certain
parties and then also append to a file all information submitted
online</p>
<form method="POST" action="PC-Lan-Rqst.asp"
name="pclanrqstname" onSubmit="validate()">
<div align="left">
<table border="0" cellpadding="0" width="782">
<tr>
<td width="243">Full Name:</td>
<td width="529"><input type="text" name="name"
size="32"></td>
</tr>
<tr>
<td width="243">Title.:</td>
<td width="529"><input type="text" name="title"
size="32"></td>
</tr>
<tr>
<td width="243">Extension:</td>
<td width="529"><input type="text" name="ext"
size="20"></td>
</tr>
<tr>
<td width="243">Department:</td>
<td width="529"><input type="text" name="dept"
size="20"></td>
</tr>
<tr>
<td width="243">Location:</td>
<td width="529"><input type="text" name="loc"
size="20"></td>
</tr>
<tr>
<td width="243">Requestor's Name:</td>
<td width="529"><input type="text" name="rqstrname"
size="33"></td>
</tr>
<tr>
<td width="243">Dept Head's Name:</td>
<td width="529"><input type="text" name="depthdname"
size="33"></td>
</tr>
<tr>
<td width="243">Start Date (if new hire):</td>
<td width="529"><input type="text" name="strtdate"
size="20"></td>
</tr>
<tr>
<td width="243">Assignment Dates (if temp
employee):</td>
<td width="529"><input type="text" name="tempdates"
size="20"></td>
</tr>
<tr>
<td width="243">Standard Hardware</td>
<td><select size="1" name="stdrdhdwre">
<option selected>Personal Printer</option>
<option>Network Printer</option>
</select></td>
</tr>
<tr>
<td width="243"><u>Standard</u> Software:</td>
<td width="529">Microsoft Word * Microsoft Excel *
Microsoft
Access * Microsoft PowerPoint * GroupWise/Internet
E-Mail * SAP
* IBM Emulation * Anti Virus</td>
</tr>
<tr>
<td width="243">Non Standard Software?</td>
<td width="529"><select size="1"
name="nstandswoption">
<option selected>No</option>
<option>Yes (See Below)</option>
</select></td>
</tr>
<% 'THIS IS THE LINE THAT I HAVE ENTERED
If nstandswoption = "Yes" Then
%>
<tr>
<td width="243">Non Standard Software:</td>
<td width="529"><input type="text"
name="nstandsoftware" size="20"></td>
</tr>
<tr>
<td width="772" colspan="2">
<p align="center"><b>Department Cost Center
Information<br>
(required only if you are requesting non-standard
hardware or
software)</b></td>
</tr>
<tr>
<td width="243">:Cost Center:</td>
<td width="529"><input type="text" name="costcenter"
size="20"></td>
</tr>
<tr>
<td width="243">:G/L Number:</td>
<td width="529"><input type="text" name="glnumber"
size="20"></td>
</tr>
<tr>
<td width="772" colspan="2">
<p align="center"><b>Network Directory Access</b></td>
</tr>
<tr>
<td width="243">Dept Directory Name:</td>
<td width="529"><input type="text" name="deptdirname"
size="20"></td>
</tr>
<tr>
<td width="243">Other:</td>
<td width="529"><input type="text" name="other"
size="20"></td>
</tr>
<tr>
<td width="772" colspan="2">
<p align="center"><b>GroupWise Public Groups</b></td>
</tr>
<tr>
<td width="243">Add to (Group Name):</td>
<td width="529"><input type="text" name="addgroup"
size="20"></td>
</tr>
<tr>
<td width="243">Remove from (Group Name):</td>
<td width="529"><input type="text" name="removegroup"
size="20"></td>
</tr>
<tr>
<td width="243" valign="top">Justification for
Non-Standard
Hardware and Software:</td>
<td width="529"><textarea rows="7"
name="justification" cols="43"></textarea></td>
</tr>
<%
End if
%>
<tr>
<td width="243" valign="top"> </td>
<td width="529"> </td>
</tr>
<tr>
<td width="243" valign="top"> </td>
<td width="529">
<input type="submit" value="Send Message"
name="Send"></td>
</tr>
</table>
</div>
<input type="hidden" name="mode" value="Send">
</form>
<script language="vbscript">
sub validate()
if trim(len(document.suggest.from.value)) = 0 then
msg = "Please note that you must provide your name" & vbcrlf & "if
you'd like to hear back from us for your suggestions..." & vbcrlf &
vbcrlf & "Continue to send this anonymously?"
if msgbox(msg, vbYesNo, "Please wait!") <> 1 then
window.event.returnvalue = false
document.suggest.from.focus()
exit sub
end if
end if
end sub
</script>
<% end if
if mode = "Send" and Err = 0 then
%>
<h2> </h2>
<p><img border="0" src="../images/success.jpg"></p>
<p>The following information has been successfully submitted</p>
<p>Name : <font color="#0000FF"> <%=name%></font><br>
Title : <font color="#0000FF"> <%=title%></font><br>
Ext.: <font color="#0000FF"> <%=ext%></font><br>
Department : <font color="#0000FF"> <%=dept%></font><br>
Location : <font color="#0000FF"> <%=loc%></font><br>
Requestor Name : <font color="#0000FF"> <%=rqstrname%></font><br>
Dept Head Name : <font color="#0000FF"> <%=depthdname%></font><br>
Start Date : <font color="#0000FF"> <%=strdate%></font><br>
Assignment Dates (Temp) : <font color="#0000FF">
<%=tempdates%></font><br>
Standard Hardware : <font color="#0000FF"> <%=stdrdhdwre%></font><br>
Non-Standard Software : <font color="#0000FF">
<%=nstandsoftware%></font><br>
Cost Center : <font color="#0000FF"> <%=costcenter%></font><br>
GL Number : <font color="#0000FF"> <%=glnumber%></font><br>
Dept Director's Name : <font color="#0000FF">
<%=deptdirname%></font><br>
Other : <font color="#0000FF"> <%=other%></font><br>
Add to Group : <font color="#0000FF"> <%=addgroup%></font><br>
Remove from Group : <font color="#0000FF"> <%=removegroup%></font><br>
Justification : <font color="#0000FF"> <%=justification%></font><br>
<%
end if
********End of Code********