Click to See Complete Forum and Search --> : Form config file prob


entropi
11-11-2003, 09:20 PM
I have written a form that calls the configuration file that tells the form what to do. In it, I included things like what fields are required, where to send copies of the filled out form, etc. I would like to be able to configure it so that it is sorted in the order I want when its sent to me. How do I do that? Im using a .con type config file (dont know if that matters).

Thx

Jeff Mott
11-11-2003, 09:33 PM
Since we have no idea of the format of your config file this answer may be a bit vague. Place in your config file a list of every form control name, then in your Perl program read that list in to an array. Once that's done you can print them out in that order like sofor (@ordered_names) {
print $_, ': ', $cgi->param($_), "\n" if $cgi->param($_);
}

entropi
11-11-2003, 09:58 PM
You know what? I wrote that so fast and it was wrong anyway - good answer though, but I was looking for something else. If I can explain it properly this time, you might have a better idea.

I have a link to mail.pl that calls on mail.con for configuration for certain things, and now that I think of it, I might not have to put it in the config file. But I dont need a print function, I just need to specify to sort the fields when they come out to me in the emails I get. I tried to do this:

<input type="hidden" name="sort" value="firstname, lastname, address, city, state, zipcode">

but of course that didnt work. I need to put it in the mail.pl file instead right?

My forms are mailed to me like such:

Admethod = Search Engine
mailConf = /forms/order.con
Submit = Submit The Form
address = 123 Test St
city = blablah
email = kjkfh@kjfkf.com
firstname = Bobby
homephone = 321-765-2016
lastname = Testypants
otherphone = 123-465-7891
state = California
zipcode = 21212

Which isnt what I want my info to look like when I get it, but I dont know how to tell it how to sort the way I want.

hussarweb
11-13-2003, 09:47 AM
does this Field Reformat 1.1 help?

http://www.massimocorner.com/dw/behaviors/