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

Anthony Baratta anthony at baratta.com
Wed Nov 29 12:29:30 CST 2006


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

-----Original message-----
From: "Casey Crookston" caseyc at IntelliSoftmn.com
Date: Wed, 29 Nov 2006 10:21:45 -0800
To: thelist at lists.evolt.org
Subject: [thelist] .NET: help with a form parsing script

> 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("_", "&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
> 




More information about the thelist mailing list