Page 1 of 1

CMSms 1.5.1 / Form Builder module - NOT XHTML valid !

Posted: Wed Dec 17, 2008 3:32 pm
by pamelina
Hi there !

I use FormBuilder 0.5.5 module with CMSms 1.5.1 ...
However it fails to XHTML validate the website when there is contact form installed ...

{cms_module module='FormBuilder' form='contact_me'}


Here is what I get ...

#  Error  Line 220, Column 130: duplicate specification of attribute "id".

…m" type="submit" class="fbsubmit" id="fbsubmit3"  />



You have specified an attribute more than once. Example: Using the "height" attribute twice on the same "img" tag.
# Error Line 220, Column > 80: XML Parsing Error: Attribute id redefined.

…5fbrp_submit" id="m5fbrp_submit" value="Submit Form" type="submit" class="fbs…


When CMSms 1.4.1 is used everithing works just fine ....

Regards

Re: CMSms 1.5.1 / Form Builder module - NOT XHTML valid !

Posted: Wed Dec 17, 2008 10:06 pm
by carasmo
go to modules/formbuilder/classes

get the Form.class.php

make a copy for safety


go to lines

749 -751

Code: Select all

	   $mod->smarty->assign('submit',$jsStr . $mod->CreateInputSubmit($id, 'fbrp_submit',
				$this->GetAttr('submit_button_text'),
				'class="fbsubmit" id="fbsubmit'.$this->Id.'"'.$jsTrigger.' '.$js));
change to:

Code: Select all

	   $mod->smarty->assign('submit',$jsStr . $mod->CreateInputSubmit($id, 'fbrp_submit',
				$this->GetAttr('submit_button_text'),
				'class="fbsubmit"'));

The other submit in the first part removes the text from the button in the rendered xhtml, that is why I removed the second one. However, the second one uses the javascript function, if you use javascript with the form it won't work and another solution will need to be used.

BTW use phpCaptcha, the other errors 66 or so with validating the xhtml

Re: CMSms 1.5.1 / Form Builder module - NOT XHTML valid !

Posted: Wed Dec 17, 2008 10:08 pm
by carasmo
Oh yeah, I don't have time now, but compare the Form.class.php with the 1.41 version and see what happened, perhaps a quick fix to make it work with Javascript too.