Page 1 of 1

change size of form's text input

Posted: Tue Jun 01, 2010 6:58 pm
by jocando
Hi

I've got a really easy question, but I can't find the answer...

I've used Formbuilder to make a form.  It's just two text inputs - name and email.
I want to change the size of the text inputs from 25 (the default) to something else.  The Formbuilder help file says...
"Text Input. This is a standard text field. You can limit the length, and apply various validation functions to the field."
...but doesn't tell you how.



Can anyone point me in the right direction?

Many thanks
Jo

Re: change size of form's text input

Posted: Thu Aug 19, 2010 7:13 pm
by Parapet
jocando wrote: I want to change the size of the text inputs from 25 (the default) to something else.  The Formbuilder help file says...
"Text Input. This is a standard text field. You can limit the length, and apply various validation functions to the field."
...but doesn't tell you how.

Of the two items you have bolded, the MAXLENGTH is controlled from the user interface within the Formbuilder fields--use the maxlength box on the Main tab of each field to set this size. This only increases how many characters a user may enter in the input box, however.

The SIZE, the other item you bolded, is controlled within the module itself. You will need to edit the file
/modules/Formbuilder/classes/TextField.class.php, starting on line 48 in Formbuilder 0.6.3, where you will see the following:

Code: Select all

return $mod->fbCreateInputText($id, 'fbrp__'.$this->Id,($this->Value?$this->Value:$this->GetOption('default')),$this->GetOption('length')<25?$this->GetOption('length'):25, $this->GetOption('length'),
($this->GetOption('clear_default','0')==1?(' onfocus="if(this.value==this.defaultValue) this.value=\'\';" onblur="if(this.value==\'\') this.value=this.defaultValue;"'):' ').$js.$ro.$this->GetCSSIdTag());
Change the "25" located in two places in this piece of code to your desired length, and that will adjust the visible length of your input boxes. Be aware, though, that this will affect all input text boxes you create with Formbuilder.

Pat

Re: change size of form's text input

Posted: Fri Sep 03, 2010 7:30 pm
by Dr.CSS
This is actually very easy to do with CSS, I do it all the time, the hard coded stuff is just if you don't have CSS controlling it it will be that size...