Moderators: Derry, Goldie, Harpo
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Guru 'Geezer' Mechanic
Picture of larryd
Posted
In helping another forum member with his form problems, I noticed that his form contained 3 input text boxes that had the same name.

I do not think that this should be allowed to happen. Form elements in the same form need to have unique names. If not, then:

(1) Form verification scripts would most likely fail.
(2) The data passed on the query string would contain multiple names. This could cause a processing script to only extract one name-value pair, ignoring the duplicates.
 
Posts: 3610 | Registered: December 03, 2006Reply With QuoteEdit or Delete MessageReport This Post
Guru 'Power' Mechanic
Picture of Bruceee
Posted Hide Post
One exception to this is radio buttons which must have the same name in order for them to belong to the same interdependent group.

The default names that SiteSpinner uses for form objects are form1, form2 etc. They start off unique, but there is nothing to stop users later giving objects the same name -- I think this is Larry's complaint.

While in this area, might it be possible to change the default name from form1, form2 etc to formObj1, formObj2, etc? Something to distinguish an object on the form from the form itself. I don't suggest TextBox1 or TextArea1 etc because that would cause naming confusion should users change the object type from say a text box to a text area.
 
Posts: 7959 | Location: Wellington, New Zealand | Registered: December 11, 2003Reply With QuoteEdit or Delete MessageReport This Post
VM Staff
Picture of Derry
Posted Hide Post
That would be a good thing Larry but it might be complicated. Form objects can be moved between forms and input types can be changed. An item would have to be checked for uniqueness within its current form, probably at publish time. That is heading towards validating user code which is a big can or worms.

Having the same name is not incorrect HTML per se (so not technically a bug). If someone found a reason to use non-unique names there would be a problem.

I will make sure it is on our list but I think it may be more of a 'nice to have' feature.

Changing the default name prefix for form items also make sense and would not be difficult to change. Technically, the name should be 'input' since these are input elements inside a 'form' element. So it would be input1, input2 etc.

Sound OK?


- Derry
 
Posts: 4095 | Location: Toronto, Canada | Registered: January 08, 2003Reply With QuoteEdit or Delete MessageReport This Post
Guru 'Power' Mechanic
Picture of Bruceee
Posted Hide Post
Sounds fine to me -- I hadn't thought about objects moving between forms. If users want to deliberately give form objects the same name, the software shouldn't stop them. Users may have a valid reason for doing so -- then "clever software" could be too clever.

Larry may have some other comments.

Regarding the default name prefix -- yes, I'd be quite happy with input1, input2 etc.
 
Posts: 7959 | Location: Wellington, New Zealand | Registered: December 11, 2003Reply With QuoteEdit or Delete MessageReport This Post
Guru 'Geezer' Mechanic
Picture of larryd
Posted Hide Post
I'm sure the problem I saw was an isolated occurrence and probably would not happen often enough to justify the cost of the change. It is a pretty visible error when viewing the HTML code. I was hoping that the logic used to prevent duplicate object, geometry, and page names could be used with forms, but that does not appear to be applicable.

Changing the automatically generated names to anything but "form" would help reduce confusion since the form itself is given an automatic name of "form".
 
Posts: 3610 | Registered: December 03, 2006Reply With QuoteEdit or Delete MessageReport This Post
VM Staff
Picture of Derry
Posted Hide Post
OK, we'll see what we can do.


- Derry
 
Posts: 4095 | Location: Toronto, Canada | Registered: January 08, 2003Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community  
 


™ & © 1998 - 2008, Virtual Mechanics Inc. All rights reserved.