Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,194,734 members, 7,955,786 topics. Date: Sunday, 22 September 2024 at 03:07 PM

Dynamic Form, Php Mysql Application - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Dynamic Form, Php Mysql Application (2429 Views)

Php/mysql Pin And Serial Number Generation Script / Dynamic Web Design Tutorials Ft Javascript,Ajax,DOM,PHP,MySQL... / Building Dynamic Websites With MySQL And PHP (2) (3) (4)

(1) (Reply) (Go Down)

Dynamic Form, Php Mysql Application by pagolina: 3:07pm On Jun 26, 2009
i had a problem designing this web form,

the form contain COUNTRY, STATE, LGA, and the form object are drop down menus/list.
i want the user to choose the country and it will generate the values of the state from the database,
when the user choose the state it will generate the LGA from the database tool,

how do i do it?

i use php mysql for my application
Re: Dynamic Form, Php Mysql Application by TechPros(m): 4:23pm On Jun 26, 2009
you will need ajax for that or you use javascript onchange event.
the difference > Ajax ( no reloading of page) while javascript (there will be a reload of page)

using javascript
1. define a funtion that load that same page and pass the value of the list in the url
2. call the funtion onchange of list value
3. write a php code to load values of the country, state and LGA base on that.

the code,
Re: Dynamic Form, Php Mysql Application by yawatide(f): 7:48pm On Jun 26, 2009
Not to put sand in your food tech pros but you don't necessarily have to use ajax, though it would be ideal.

He could also call a function that refreshes the page each time a selection is made. I only mention this as ajax usually has a huge learning curve (I know it was for me) and so sometimes, starting with the basics makes sense. Alternatively, he could use a ready-made framework like scriptaculous, jquery or mootools that already has done the dirty work for him. Of course, having the page refresh 3 times, for each selection, especially on a slow connection isn't exactly what one would call ideal but sometimes, tis best to crawl (page refresh) b4 u walk (ajax).

Again, not putting sand in your garri. Just offering another alterntive.
Re: Dynamic Form, Php Mysql Application by Nobody: 1:13am On Jun 27, 2009
*Strolled by* oh well, many ways to solve the problem.
@poster, i have some ajax scripts that seem to solve that
problem. Buuut, if you do not know javascript/ajax, then i
will never advise you to use that approach, as you will
surely get stuck.
Re: Dynamic Form, Php Mysql Application by pagolina: 3:08pm On Jun 27, 2009
so if i want to use jquery how do i use jquery to achieve that
Re: Dynamic Form, Php Mysql Application by yawatide(f): 8:55pm On Jun 27, 2009
There are plenty of tutorials at jquery.com - just search for the right plug-in, thatz all. I haven't used it myself but I know it is there. with libs like jquery, the good thing is, you just download the necessary files, modify to suit your needs and you are up and running in no time.

Good luck!
Re: Dynamic Form, Php Mysql Application by Nobody: 10:49pm On Jun 27, 2009
Exactly, jquery will be better and faster too.

(1) (Reply)

How Much Does A Dedicated Server Cost? / Facebook Vs Twitter Demographics – Infographic / Cheap Maxbounty & Peerfly Account For Sale!

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 10
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.