I need to make a form to retrieve values from database. The form will have a date field AND/OR drop-down and a row of three fields as default. The user can add/remove extra rows as per required.
The three fields are:
drop-down with options as table name from db(eg. employee_name,vehicle_name etc)
drop-down for conditions (like/equal-to/greater-than etc)
text-box where user can input data (eg. ford,suzuki etc).
How can I make a form where I can add/remove fields as required and then retrieve the values through a PHP code and use that as query to select and display appropriate values from database?
I use PHP Codeigniter method to build this custom search form.
form image
Related
I have a Gravity Form in which I need to populate a field with information from a MySQL database table wp_doordata based on a match with a drop-down selection in the previous field.
Below an example
I select the value "CRP10" from the drop-down. I need to query the MySQL database table and select the field door_data that matches the selection of the value "CRP10" and populate the field "door_data" in the Gravity Form.
I can do this in PHP, but am not familiar with Wordpress/Gravity Forms as much and would appreciate any help.
So I have a page that dynamically populates mysql data depending on how many entries meet the sql query conditions.
So if 10 entries are displayed after querying the DB, there are 10 sets of data, each with its unique table id in a hidden input, all visually separated with fieldset tags, and so 10 update entry buttons at the bottom of each fieldset so the user can click the button if any data in a particular fieldset section is altered.
Is it possible to encapsulate the data in each fieldset in form tags as well so the data enclosed can be updated in the DB if altered by the user?
I'm using the Formidable Pro WordPress plugin to create editable forms. Each form has several different "Contact Info" areas (in the below picture, one such area is "General Contractor", and another one is "Mechanical Engineer"), and each area has several inputs.
What I'm looking to create:
Enter first few letters of persons name in "Contact" input
Select a name from resulting Autocomplete drop-down
Populate nearby fields with Contact's respective information (Company, Email, Phone, Fax, Tax ID, and Address)
The first image below shows two of the "Contact Info" areas (the first of which I drew in each input's ID). The second image shows how each Contact's information is stored in a MySQL table.
So are there any Autocomplete WordPress or jQuery plugins that can help me accomplish this, and if so, how would I go about implementing this feature?
I'm guessing for the drop-downs you're using dynamic fields? Replace these with Lookup fields and then you can automatically populate values of other fields like so:
For each field you want auto-populated, go into the field settings and check the option 'Dynamically retrieve the value from a Lookup field'. Then, for the 'Get value from' options, you'll need to select the form and field you want to Get the data from. Then, for the 'Watch Lookup fields' option you'll need to select the lookup field (which will be your 'Contact' input that users are typing into).
I want to edit/update, multiple rows together in Yii CGridView.
Say, each row has a checkbox and a single edit/update button, I select multiple rows and by clicking on edit/update button all selected rows are opened for editing and update.
Is this possible with Yii CGridView..??
Use the selectableRows property of the CGridView.
According to Yii Documentation for CGridView
public integer $selectableRows;
the number of table body rows that can be selected. If 0, it means rows cannot be selected. If 1, only one row can be selected. If 2 or any other number, it means multiple rows can be selected. A selected row will have a CSS class named 'selected'.
You can use the the $.fn.yiiGridView.getSelection(containerID) to retrieve the key values of the selected rows.
Add some more buttons either at the top or bottom of the gridview with actions for edit, delete or whatever action you need to take and pass the key values retrieved above.
If you want to edit rows in-line you can use extension phaActiveColumn which I messed up to support multiple rows (the whole table if desired).
EDIT: well, the extension basically creates an input field replacing the grid cell when user clicks on the cell. The field will have the cell's value for starters and it then sends an ajax call to controller, as soon as the user presses enter, asking to save the value of the field, which will be the user's input.
My addition was to create one such field for every cell in the row and store user input in javascript objects which then get send all at once with one ajax call to the controller. Multiple row updates are supported (creating adequate number of javascript objetcs).
If anyone has any interest in this there it is.
phaEditColumn2
phaAbsActiveColumn2
I need MySQL Schema for form generation system, I have created form designer but i need to store it in MySQL.
This system can do following
Create your own form
Add or remove as much fields as you want
Form will connect to a MySQL Table which is going to store form submission data
How it can be done, plz help me
Try using the Entity-attribute-value model (EAV).
Example table for form data:
ID
Name
Value
So for a form with 5 fields, each form would have 5 rows. Name would be the fieldname, value the filled in value.