Field name order in AutoGenerated code

Bullfn33 03 Aug, 2008
The order of the field names in the saved data of my form is important and I'm wondering how to make sure I have the data in the correct order when it is submitted. How does the AutoGenerated code order the field names? Is it alphabetically or tab order? The order the field names appear on my form is a little different from the order I need them submitted into. thanks
GreyHead 03 Aug, 2008
Hi Bullfn33,

ChronoForms simply scans your form html and pulls out a list of 'name's from it. There's nothing sophisticated about it.

The table columns it creates are in the same order. You can use a template to display fields in a different order in the email; the sequence in the database table is usually unimportant because you can very easily change it when you read the table.

If you need to you can create a new table manually and then re-write the sql in the Autogenerated tab using the SET syntax to put the fields in a particular order.

Bob
Bullfn33 03 Aug, 2008

The table columns it creates are in the same order. You can use a template to display fields in a different order in the email; the sequence in the database table is usually unimportant because you can very easily change it when you read the table.


how can you change the order when you read the table?

If you need to you can create a new table manually and then re-write the sql in the Autogenerated tab using the SET syntax to put the fields in a particular order.


That's what I have been doing, just changing it in the tab, but I was wondering if there was a way to have it display the order automatically in the order I would like it so I don't have to change it in the AutoGenerated tab each time I make a new form, which I'd have to do frequently. It sounds like it grabs the field names in the order they appear on the page. Is that correct?
GreyHead 03 Aug, 2008
Hi bullfn33,

It depends how you are accessing the table data - most ofen you read a table row into a list or an object and then re-format it into a table for display, then you can specify any order for the display. Or you can write SQL that does SELECT field_1, field_6, field_2,. . .

Yes, ChronoForms just read through the form html and creates a list of the names that it finds.

Bob
Bullfn33 03 Aug, 2008
Alright, thanks.
This topic is locked and no more replies can be posted.