change size of form's text input

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
jocando
Forum Members
Forum Members
Posts: 50
Joined: Thu Feb 19, 2009 4:20 pm

change size of form's text input

Post 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
Parapet
Forum Members
Forum Members
Posts: 26
Joined: Tue Jul 28, 2009 8:19 pm

Re: change size of form's text input

Post 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
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: change size of form's text input

Post 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...
Post Reply

Return to “Layout and Design (CSS & HTML)”