Breaking News
You are here : Home / Web development / PHP / PHP form Builder Class
Form builder class

PHP form Builder Class

PHP form Builder Class:

Php form Builder class is used to generate html form .it will provide re usability for your Php projects.All you need is include this form builder class in your project and all your  PHP Forms can be easily generated without repeating the code using this Form Generator.using  this php form builder class you can generate input ,select,radio, text area etc. you can also generate What you see what you get editor using this php form builder . So you dont need to waste your time searching what you see what you get editor. So whichis very good feature of Php form builder .So that was a overview lets move on and see how this form builder class works.

[jbutton icon=”download” link=”” size=”xlarge”]Download[/jbutton] [jbutton icon=”globe” size=”xlarge” link=”” newpage=”yes”]Live Demo[/jbutton]

Setting up Php form Builder class in your project:

Firstly include the form builder class in your php script page with jquery library and form builder style sheet(formbuilder.css) .place the php form builder folder in your project and then include form builder where you need it.Then we start Generating forms using this Form Generator

So now we have included the important Php form builder files now we create our forms using form builder class . I will show you one by one creating each element using the php form builder class . Lets take a look at syntax for the Php form builder class in detail.


Syntax’s For the PHP Form Builder Class:

So we now lets take a look at some syntaxes .we firstly create an instance of the form builder  . then we furthur create theform elements using the form builder instance we created.

Creating instance of php form builder class:

The Above code will output the html form tag with method post and class=”formbuilder” nad action as defined.


PHP Form builder Input Elements:

The above code will create a PHP Form builder input text box and second one will create Input box with type =”password” which will act as password field.


PHP Form builder Select Elements Syntax:

The select element of the php form builder class is divided in to categories:

first the simple select box without optgroup.

Second select box syntax wih the  optgroup

So first we look at syntax without optgroup.see below the basic syntax for Form Generator

From above code Form Generator will output simple select box with 3 options and 3rd option will be selected by default.

Now we take a look at Php form builder second syntax for the select box .

The above code will out put two optgroups tags cars and bikes and by default 3rd option of 1st optgroup will be selected.


PHP Form builder Radio Button Elements Syntax:

Now we take a look at radio button sytax for the php form builder class .

See below the radio syntax:

as we can see the code is pretty clear and easy .we passed 3 arguments ‘label’ then buttons as array.and then finally attributes for the radio buttons.the above code will output two radio buttons .these two will having same attributes .In this case both will have name=”sex”.Now take a look at 2nd attribute ,we have passed key=>value radio button with label male will have value ‘M’ .alternatively for radio button we can also pass simple that case the label will be same as value.

lets take a look at alternative call to radio:


PHP Form Checkbox Elements Syntax:

the Check box syntax is exactly same as the radio button.So i think they don’t need any description .like radio button check box 2nd argument can be key=>value or just simple array.lets see all possible syntaxes:


PHP Form Textarea Syntax:

Lets take a look at php form builder class Textarea syntax:

As we can see the form builder class syntax for the textarea with first argument as label and second is the attributes as key=>value


PHP Form Builder WYSIWYG Syntax(WYSIWYG Form Generator):

So Now we’ll see interesting and great feature of Php form builder class.Php form builder class has integrated what you se what you get editor .with one single line the editor will display on your form.Lets see the syntax for the editor

The above code will output textarea with tiny mce.


PHP Form Builder Submit Syntax:

Prints the submit button
That was all from the PHP Form builder class . You can Download the source or See the Live Demo.

Download Demo

Thanks for Visiting design Aeon .If you liked our post then please like and share.


Tags : , , , ,

Leave a Reply

Want to join the discussion ? Feel Free to contribute !