Multiple FormBuilder forms on one Page (multiple CSS IDs)

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Contact:

Multiple FormBuilder forms on one Page (multiple CSS IDs)

Post by paulbaker »

I note that the FormBuilder (0.7.2) help says
In theory, you can have multiple forms on a page if you really want to.
Multiple forms do work, sort of. Problem is the CSS IDs of the form elements are the same for each instance of the form. That means you can't address each one individually.

So, when you use the "Default value for field" box for a Text Area field and tick the "Clear default on click" box, you end up with multiple instances of this on your page:

Code: Select all

<textarea name="cntnt01fbrp__18" cols="60" rows="5" class="cms_textarea" id="message">Message</textarea><__script__ type="text/javascript">
var f = document.getElementById('message');
if (f)
{
f.onfocus=function(){
if (this.value==this.defaultValue) {this.value='';}
}
f.onblur=function(){
if (this.value=='') {this.value=this.defaultValue;}
}
}
;</__script>
Note the id="message" and getElementById('message'). Works fine for the first one but breaks for all the rest (in IE 9 anyway).

Would love to hear any ideas for a work-round on this?

Thanks O0
Post Reply

Return to “Modules/Add-Ons”