[thelist] .NET: help with a form parsing script

Casey Crookston caseyc at IntelliSoftmn.com
Wed Nov 29 12:42:32 CST 2006

>>You have no values for your check boxes. The name of the check box is
being used as the default value.<<

That's what I would have thought as well.  But here's the HTML:

<asp:CheckBoxList id="How" runat="server" CssClass="form"
RepeatDirection="Horizontal" Width="369px" RepeatColumns="2">

<asp:ListItem Value="FPC Magazine Add">FPC Magazine Add</asp:ListItem>

<asp:ListItem Value="AFSA Ultimate Sprinkler Guide">AFSA Ultimate
Sprinkler Guide</asp:ListItem>

<asp:ListItem Value="Hydratec Inc.">Hydratec Inc.</asp:ListItem>

<asp:ListItem Value="NFSA">NFSA</asp:ListItem>

<asp:ListItem Value="Internet Search">Internet Search</asp:ListItem>

<asp:ListItem Value="Other">Other</asp:ListItem>


Do I need to add a Name as well?

-----Original message-----
From: "Casey Crookston" 

> I made a little script which parses a form submission.  It does a good
> job with text boxes and radio button lists, but I'm having trouble
> check box lists.  A sample of the form is here:
> http://dev.norfire.com/norfire_request_kit.aspx
> If you fill it out (with dummy data) and hit submit, you'll notice
> the check boxes render as: "How:2 on" instead of showing the actual
> values, as it does with the radio buttons.  
> Here's the code with parses the script:
> ~~~~~~~~~~~~~~~~~~~~~~~~~~
> Dim i As Integer
> Dim form_item as string
> Dim form_value as string
> lbl_submit.Text = "<table width='300'>"
> For i = 1 To (Request.Form.Count - 2)
> 	form_item = Request.Form.AllKeys(i).Replace("_", "&nbsp;")
> 	form_value = Request.Form(i)
> 	lbl_submit.Text &= "<tr><td>" & form_item & ": </td><td>" &
> form_value & "</td></tr>"
> Next i
> lbl_submit.Text &= "</table>"
> ~~~~~~~~~~~~~~~~~~~~~~~~~~
> Thanks!
> Casey


* * Please support the community that supports you.  * *

For unsubscribe and other options, including the Tip Harvester 
and archives of thelist go to: http://lists.evolt.org 
Workers of the Web, evolt ! 

More information about the thelist mailing list