Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I have a form that can add information in database using php/mysql. I can make that form to show in pop up window and can insert data in database. Suppose I have city form which have city_id, city_name, city_abbreviation. I have create a html form that can insert data in city table using php/mysql. Now I want to make pop up form and insert data in database.
The easiest way to do this is to use jQueryUI's dialog() widget. It's unbelievably simple:
$('#someDivID').dialog();
The above command takes whatever it inside the div containing the attribute id="someDivID" and displays it in a pop-up. The displayed DIV works exactly the same as it would without being in a pop-up.
Note that you must have both the jQuery library and the jQueryUI library referenced in your document, as per > this other question < with a more complete explanation of the jQueryUI dialog widget.
Since you already know how to create a form and submit it to a PHP file for entry into a MySQL database, I won't repeat that here -- but if you need help with that, leave a comment.
Next, you might wish to know how to input the form data into the database without leaving the page you are on. That is, the popup will close and you want the data to be placed into the database "behind the scenes", without changing to a different page.
That is done via AJAX -- also unbelievably simple. Please see these additional posts for information:
A simple example
More complicated example
Populate dropdown 2 based on selection in dropdown 1
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I want ask something about Code Igniter Dynamic Form.
I want to make a Form. Every tag like input, text area, etc, and attribute like id, class, etc of that Form stored in database. No hard code in html/php. Only fetch the attribute and tag from database, the Controller will load from database and send to View. And automatically will display the Form like what I saved in database.
In this case, the future of this form will be increased or reduced without need to hard coding by the developer.
Anyone can tell me how to make like that. And give reference link to me, so i can learn it.
Looking at this github project may help you to get the idea
Generate a form from a DB table
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
so I am working on a small ecommerce site and I've been stuck on this section of my site for quite a while now and can't really wrap my head around it.
I have divided the site into 3 columns with bootstrap's grid system, in the main section I have my featured products, however, I'd like everything to be dynamic, when I click on a modal with "View details" for the product the only code that works is the dynamic one, I'd like to know how to make it so that it pulls the data directly from my database, unfortunately out of frustration I deleted the little work I had done on it and can't show stick it on here so that anyone can correct it for me.
Could anyone please help me out?
Thanks!
There are many ways you could go about doing this. Here is an approach you could use:
Get the id from data attribute of your product (make sure you load it into the html).
Send a $.get request with jquery for this id to the server.
Get the data needed from the db using this id.
Render the data server side
Return html
In the callback function of your get request put the HTML into your bootstrap modal body.
Show the modal to the user.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have a table called invoice_details consisting of :
id
invoice_id
product_id
product_name
quantity
price
I have a form field that allows input of the product name,qty,etc.
I want to add a column that will be called "room". The script I have now auto generates more form fields as I need them, in which I could add "room" and specify within the form field, but I want to have the following workflow :
Page loads Rooms(or lack of)
click a button to add a room(or
multiples)
ability to search products, and click and drag products
to specific rooms
have all data saved correspondingly in sql
database
What web technologies do I need to research to be able to achieve the above result?
JavaScript/jQuery to handle the front end clicking dragging
PHP (I assume you're already using it) to handle the database queries
PDO - a function in PHP for writing to databases
AJAX - a way of getting data from your JavaScript front end to the PHP backend
Incidentally - you might want to look at InteractJS which is designed to handle the drag and drop your're looking for - you just have to then AJAX the data back to your PHP server for processing.
Good luck!
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have 3 dependent dropdown which coded in php and to move on second dropdown i have to select the first dropdown.on the value of that first drop down it shows the value of second dropdown from the database.to show the database data in dropdown i need the selected value of firstdrop down.and it will use that value for select query like
("select id,name,city_id from tab WHERE city_id="$selectedvaluofdropdown).
Now the problem is i have to do this without redirecting the php page.and without using ajax or jquery.is it posible...
You can set all the available values of dropdowns in the variable javascript them into json using json_encode. Then if you change the values of the dependent change dropdown using js
Drop down selection happens on client side. PHPs job is over once the page is displayed. You have to use AJAX / JQuery to do something like this (without redirecting or reloading the page).
There is no way to call php scripts without reloading the php unless you use AJAX.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
How would I go about creating a table that is linked to a specific user that can be edited by that user? Basically a user would log in, and they would see a button that took them to a page with a bunch of specifically labeled input boxes. They could put the appropriate data into the boxes and save it. There should also be a drop down menu that contains presets for the data. At first I thought to use a database, but here's the kicker: They need to be able to add and delete input boxes. To recap, the user needs to have their own specific page that allows them to change data in input boxes, as well as add more fields if they require it. This all needs to be stored and linked to their user. How can I do this?
You should realize that in PHP / MySQL. I do not know where you are in your project, if you have already achieved your login pages / sing_up / index ... etc.. but you should start with that. There are good tutorials on the subject, like this one.
http://net.tutsplus.com/tutorials/php/user-membership-with-php
EDIT:
To let user edit their info, look at this tutorial:
http://www.webestools.com/scripts_tutorials-code-source-14-members-area-system-in-php-mysql-members-users-system-area-log-sign.html
After, you will have to ajust your actual structure to the one they give.