For Programmers: Free Programming Magazines  


Home > Archive > ASP > February 2005 > Checkbox Question









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Checkbox Question
HartNA

2005-02-23, 3:55 pm

I have a script that will work on it is own, but the problem is the site I
am trying to implement the checkbox on a site with attachments on the same
form. In my testing I check LOW. The result I am looking for is YES, but
it keeps coming up NO

Here is a snippet from the HTML code

<form enctype="multipart/form-data" action="helpsoft_process.asp"
method="POST">
<td align=center width="150" class="pbMain_data3"><input type="checkbox"
name="prLow" value="">Low</td>
<td align=center width="150" class="pbMain_data3"><input type="checkbox"
name="prMed" value="">Med</td>
<td align=center width="150" class="pbMain_data3"><input type="checkbox"
name="prHigh" value="">High</td>
<td align=center width="150" class="pbMain_data3"><input type="checkbox"
name="prCrit" value="">Critical</td>

Here is a code from the ASP page

Dim mySmartUpload, intCount, Conn, RS
Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
mySmartUpload.Upload

pLow = mySmartUpload.form("prLow")
pMed = mySmartUpload.form("prMed")
pHigh = mySmartUpload.form("prHigh")
pCrit = mySmartUpload.form("prCrit")

If mySmartUpLoad.Form("prLow") = "on" Then
Response.Write "yes"
else
Response.write "no"
End If



Ray Costanzo [MVP]

2005-02-23, 3:55 pm

Give your checkboxes the same name, and then unique values as such:

<form enctype="multipart/form-data" action="helpsoft_process.asp"
method="POST">


<td align=center width="150" class="pbMain_data3"><input type="checkbox"
name="chkUrgency" value="Low">Low</td>
<td align=center width="150" class="pbMain_data3"><input type="checkbox"
name="chkUrgency" value="Med">Med</td>
<td align=center width="150" class="pbMain_data3"><input type="checkbox"
name="chkUrgency" value="High">High</td>
<td align=center width="150" class="pbMain_data3"><input type="checkbox"
name="chkUrgency" value="Critical">Critical</td>
<input type="submit">
<%
set mySmartUpload = Request

sUrgency = mySmartUpload.form("chkUrgency")
Response.Write sUrgency

%>

Ray at work

"HartNA" <dthmtlgod@hotmail.com> wrote in message
news:%23BNFgfbGFHA.1172@TK2MSFTNGP12.phx.gbl...
> I have a script that will work on it is own, but the problem is the site I
> am trying to implement the checkbox on a site with attachments on the same
> form. In my testing I check LOW. The result I am looking for is YES, but
> it keeps coming up NO
>
> Here is a snippet from the HTML code
>
> <form enctype="multipart/form-data" action="helpsoft_process.asp"
> method="POST">
> <td align=center width="150" class="pbMain_data3"><input type="checkbox"
> name="prLow" value="">Low</td>
> <td align=center width="150" class="pbMain_data3"><input type="checkbox"
> name="prMed" value="">Med</td>
> <td align=center width="150" class="pbMain_data3"><input type="checkbox"
> name="prHigh" value="">High</td>
> <td align=center width="150" class="pbMain_data3"><input type="checkbox"
> name="prCrit" value="">Critical</td>
>
> Here is a code from the ASP page
>
> Dim mySmartUpload, intCount, Conn, RS
> Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload")
> mySmartUpload.Upload
>
> pLow = mySmartUpload.form("prLow")
> pMed = mySmartUpload.form("prMed")
> pHigh = mySmartUpload.form("prHigh")
> pCrit = mySmartUpload.form("prCrit")
>
> If mySmartUpLoad.Form("prLow") = "on" Then
> Response.Write "yes"
> else
> Response.write "no"
> End If
>
>
>



HartNA

2005-02-23, 3:55 pm

Thanks, exactly what I was looking for.

"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:%23ykQBmbGFHA.1740@TK2MSFTNGP09.phx.gbl...
> Give your checkboxes the same name, and then unique values as such:
>
> <form enctype="multipart/form-data" action="helpsoft_process.asp"
> method="POST">
>
>
> <td align=center width="150" class="pbMain_data3"><input type="checkbox"
> name="chkUrgency" value="Low">Low</td>
> <td align=center width="150" class="pbMain_data3"><input type="checkbox"
> name="chkUrgency" value="Med">Med</td>
> <td align=center width="150" class="pbMain_data3"><input type="checkbox"
> name="chkUrgency" value="High">High</td>
> <td align=center width="150" class="pbMain_data3"><input type="checkbox"
> name="chkUrgency" value="Critical">Critical</td>
> <input type="submit">
> <%
> set mySmartUpload = Request
>
> sUrgency = mySmartUpload.form("chkUrgency")
> Response.Write sUrgency
>
> %>
>
> Ray at work
>
> "HartNA" <dthmtlgod@hotmail.com> wrote in message
> news:%23BNFgfbGFHA.1172@TK2MSFTNGP12.phx.gbl...
I[color=darkred]
same[color=darkred]
but[color=darkred]
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com