from dtml using REQUEST.form.items(), the order of the form variables is jumbled. is there any way to get the original order that they appeared in the <form>? assuming the browser sends them in the same order that they appear in the <form>? -d -- Adroit | Dyon Balding dyon@adroitnet.com.au Internet | http://www.adroitnet.com.au/ Solutions | work: +613 98888522, mobile: +61 0414992604
Dyon Balding wrote:
from dtml using REQUEST.form.items(), the order of the form variables is jumbled. is there any way to get the original order that they appeared in the <form>? assuming the browser sends them in the same order that they appear in the <form>?
Good luck. :( Browsers and servers are neither required to, nor are (to my knowledge) respecting any sequence of form fields. Basically, IME, if you need the data going in somewhere to be in the same order ( a program that expects certain values in certain a order, for example), have whatever processes the returned data order it for you. -- In flying I have learned that carelessness and overconfidence are usually far more dangerous than deliberately accepted risks. -- Wilbur Wright in a letter to his father, September 1900
Dyon Balding wrote:
from dtml using REQUEST.form.items(), the order of the form variables is jumbled. is there any way to get the original order that they appeared in the <form>? assuming the browser sends them in the same order that they appear in the <form>?
Not if you do not name them explicitly. The REQUEST.form.items() is a python dictionary. Keys of a dictionary have no fixed order. You could sort them if you wanted to, but that would be a computer order, not the original order in which they appeared. Rik
I have not obviously researched this in detail (perhaps you may want to) but I do not believe that the any of the various web rfcs define that either the client or server should send/expect any form elements in any explict order, and that if any order is mentioned at all it is probably 'implementation defined'. The introduction of various CGI interface libraries for various languages probably munges this even further. I would not rely on any consistent order at all coming from any system. -Michel Dyon Balding wrote:
from dtml using REQUEST.form.items(), the order of the form variables is jumbled. is there any way to get the original order that they appeared in the <form>? assuming the browser sends them in the same order that they appear in the <form>?
-d
-- Adroit | Dyon Balding dyon@adroitnet.com.au Internet | http://www.adroitnet.com.au/ Solutions | work: +613 98888522, mobile: +61 0414992604
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (4)
-
Bill Anderson -
Dyon Balding -
Michel Pelletier -
Rik Hoekstra