Here's a simple form debug python script - allows for simple verficiation of posted form values for rapid development. That is if you want to make sure your form values are getting posted correctly before you write a production form handler
import System import System.IO import sys import re #regular expressions import clr
from System import * from System.IO import * from System.Text import * from System.Net import * clr.AddReference('System.Web') from System.Web.HttpContext import Current
# super simple form validation #create a dictionary list of expected fields from form submission [make sure input field ids to match key names] allowed_fields = { 'desu': '', 'mudkips': '', 'pb': '' };
print '<pre>'
print 'before processing' for key in allowed_fields: print key + '=' + allowed_fields[key] print ''
requestType = Current.Request.RequestType if requestType=='POST': PostedForm = Current.Request.Form for key in PostedForm: print 'POST:' + key + '=' + PostedForm[key] key_exists = allowed_fields.has_key(key) if key_exists: allowed_fields[key] = PostedForm[key]
print '' print 'after processing' for key in allowed_fields: print key + '=' + allowed_fields[key]
print '</pre>'
#simple
You could of course extend this to print out discarded / invalid posted values as well for further validation.
foreach over post/get variables in python or xslt
{preferably python} I just need to quickly to print out all request variables:
This approach is rather weak:
"http://our.umbraco.org/wiki/reference/umbracolibrary/requestquerystring"
is there a library method that returns an array of request variables in key value pairs already prepared?
I'm sorry I should have put this in developers/xslt ... and I wouldn't double post but I've not had much luck editing in this forum to date.
Can someone please move this to the appropriate section?
Here's a simple form debug python script - allows for simple verficiation of posted form values for rapid development. That is if you want to make sure your form values are getting posted correctly before you write a production form handler
For this simple form:
Create this Macro:
You could of course extend this to print out discarded / invalid posted values as well for further validation.
is working on a reply...