Multiple items with the same ID in the view – ZF2

I am building a web application using ZF2 and Doctrine. I have a view containing a base form to which the user can add multiple instances of a fieldset, the filedsets are added via HTML template and js cloning. We are making use of the Doctrine hydrator and cascade=persist to write to the dB. It is all working but I am concerned when the fieldsets are added it results in multiple items with the same ID which breaks w3 standards. Has anyone a solution or work around for this? Or would it be considered acceptable in this instance?

An example of one fieldset element:

$this->add(array(
        'name' => 'glassAssemblyID',
        'attributes' => array(               
            'type'=> 'hidden',
            'id' => 'glassAssemblyID',
        ),
    ));

Many thanks
James

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s