[thelist] .NET: help with a form parsing script
Anthony Baratta
anthony at baratta.com
Wed Nov 29 12:58:10 CST 2006
If you check your generated HTML you see:
<input id="How_0" type="checkbox" name="How:0" /><label for="How_0">FPC Magazine Add</label>
Acording to the Help file, in your code you want something like this:
<asp:ListItem Text="Blue" Value="#0000FF" />
-----Original message-----
From: "Casey Crookston" caseyc at IntelliSoftmn.com
Date: Wed, 29 Nov 2006 10:42:32 -0800
To: "Anthony Baratta" anthony at baratta.com, thelist at lists.evolt.org
Subject: RE: [thelist] .NET: help with a form parsing script
> >>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>
>
> </asp:CheckBoxList>
>
> 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
> with
> > 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
> that
> > 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("_", " ")
> > 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. * *
> http://evolt.org/help_support_evolt/
>
> 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