When i am selecting an option from drop down box then display no. of forms with captures data.
That is looking like this.
I own a form with some fields like No. of Applicants, Applicant Name, Telephone, E-mail, etc...
When i want to select No. of Applicants are 2 then display 2 forms with relevant fields and capture the first form data to other forms.
When i want to select No. of Applicants are 4 then display 4 forms with relevant fields and capture the first form data to other forms.
It is depending upon user selection. But how many numbers are selected by user then display that forms automatically.
I am searching on Google, but not find out.
You can make it using JQuery
let no of applicants 2
for(i=1;i<=2;i++){
$("#appenddiv").append('<input type="text" name="test'+i+'" value="" />')
}
Related
I have 2 forms, each one is on a different page, and they both fill information in the same table in the database. Whenever I try to fill them up, the database displays the information as 2 entries, how I can I display the information in the same row in mysqli?
(first form asks the user to submit first name and last name, second form asks him to submit email and phone number) putting them in one form is not an option.
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'll try to explain my problem and let´s see if I get some help.
I`m trying to design a DB. This data base will contain users and forms but my problem is how to design it to save forms.
The forms will be created by the administrator when he needs them, so in the DB I have a table to save the form name. Another table with all the possible fields for all the forms and another table where form-names and fields will be save so I can see all the field that a determinated form has.
An example: In FormName table I have 3 form names: Personal Info, Computer Knowledgement and hobbies. And in Fields table I have, for example, Name, Address, Phone, Operating Systems, Programming, Bike ridding, playing pc games.
I decide to create a form with name number 1 (Personal info) and fields number 1,2,3 (Name, Address, Phone). This information is recorded in another table called full-form where it´s saved form name id and field id. This is pretty clear for me (perhaps I´wrong).
The tricky part comes now. Some user decide to fill the personal info form so the name of the form and each field will has to displayed. When the user fill the form it has to be saved some way so the administrator can see the name of the form, each field that that form has, who filled the form and the information written in each field. And all this should be displayed not only in the DB but in some different way like a table, for example.
By the way... I´m using cakephp and mysql.
Thanks in advance,
Abraham
As far as I understand, setup looks like this. As you said, we have 3 tables:
'formname' = id, name (for form names)
'formfields' = id, fieldname, attributes (for form names, added attributes in case you need them)
'forms' = id, formname_id, formfields_id, formfields_order (ready forms and possibility to order field in form)
And also you should create additional table where to store submitted values
'forms_values' = id, forms_id, value (in this case one row for each field)
If you want to relate those values to specific user, one more table should be created
'users_forms' = forms_values_id, user_id
Of course there should be users table as well.
My suggestion is to drop table 'formnames' and put form name in 'forms' table.
Then table 'forms' will contain
id, form_name, formfields_id, formfields_order
Hope this answer will put you forward :)
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
I am developing a golf website where users can track their rounds and handicaps and have a few different ideas on how the user inputs their round information. I have a table for courses and a corresponding row in another table (scorecards) that has all the courses scorecard information. The 'round recorder' is a three part form (basic, scorecard, preferences) and in the basic part of the form the course input is a autocomplete field. I was wondering if there was a way that I could use a chained select from a autocomplete field.
e.x. Course1(has 18 holes) -> List Front Nine/Back Nine (user selects one or both and than loads that scorecard from database)
Any advice or suggestions would be greatly appreciated. Thanks in advance.
This isn't the most specific answer, but basically you want to capture the "change" event of the select box. For the front or back nine, you would check whether "front", "back", or both was checked and update that accordingly within load_scorecard().
<select onchange="load_scorecard(this.value);">
and then the JS:
function load_scorecard(scorecard_id) {
// Obtain data from a database or preloaded array
// Then, update the page with the scorecard.
}