In Progress

Form Field Auto-Population from select fields

I have the following form fields that I need to be auto-populated depending on user input.

Here is the form:

<form name="populate" method="post" action="[url removed, login to view]">

<label for="cities">City</label>

<select name="cities">

<option value="1">City1</option>

<option value="2">City2</option>

<option value="3">City3</option>

</select><br/>

<label for="subs">Suburb</label>

<select name="subs"><!-- dynaic option values from cities val here with value of subsID and displayed as sub_name --></select><br/>

<input name="pop" id="pop" value="<!-- dynaic value for population from subs val here -->" /><br/>

<input name="avg" id="avg" value="<!-- dynaic value for avg age from subs val here -->" /><br/>

<input type="submit" value="submit" />

</form>

As outlined in the html above I require the form to populate the various inputs depending on what is selected in the previous input.

1) When the City value is selected (onchange) from the cities select, I need a script to gather fields from the db with a CityID equal to the selects value, using:

mysql_query("SELECT subsID, sub_name FROM subs WHERE cityID = {post_val_from_cities} ) or die(mysql_error());

2) Then when the subs select/menu is selected (onchange) I need the script to run query:-

mysql_query("SELECT population, avg_age FROM subs WHERE subsID = {post_val_from_subs} ) or die(mysql_error());

and then populate the two remaining fields with the result from the query.

This job will require your own database tables to be created for testing, db connection and values are not important as I just require a working script to gather and pre-populate these form inputs accordingly.

Thanks.

Skills: Javascript, jQuery / Prototype, PHP

See more: auto select field php, value city, val , subs, select, database population, auto form submit, form fields, php pop form, menu form, php connection select, query pop, javascript connection, user script auto, select option, php post value, method auto, auto submit javascript, menu select php, php action form, php form action, html javascript form, working auto script, php value post, html form method

About the Employer:
( 37 reviews ) Abu Dhabi, United Arab Emirates

Project ID: #1118607

Awarded to:

RajanKaneria

Hello sir, Please Check PMB.!!

$30 USD in 0 days
(9 Reviews)
3.1

20 freelancers are bidding on average $46 for this job

softsolution2000

Ready to do it right away...

$100 USD in 0 days
(92 Reviews)
6.9
DrTech76

Hi!

$30 USD in 0 days
(278 Reviews)
6.6
SiliconMind

Kindly Check PM

$50 USD in 0 days
(62 Reviews)
6.3
RedhopIT

Hi,Please check PM

$30 USD in 0 days
(65 Reviews)
6.1
stdhtelkom

Hello, see pmb. Thanks.

$30 USD in 0 days
(20 Reviews)
5.8
bdimuch

Hello, I would be happy to work for you again. Ready to start immediately and can complete the script in a couple of hours.

$30 USD in 0 days
(36 Reviews)
5.6
randdythea

hi sir,please check your PMB, tanks ^_^

$30 USD in 1 day
(76 Reviews)
5.5
surajddk

Hi, Let's start! Check PMB!

$30 USD in 1 day
(28 Reviews)
5.4
istankov85

Hi, FatFreddyDrop. I can do the project. I have done such type of work. Regards, Ivan Stankov

$30 USD in 2 days
(29 Reviews)
4.7
MakeYouBelieve

Hi, Please check your inbox to view demo. Thanks.

$30 USD in 0 days
(34 Reviews)
4.5
lexcode

i can help you

$185 USD in 1 day
(23 Reviews)
4.3
dataentry17

I m ready to start now @@ PLEASE CHECK PM @@ Thanks.

$35 USD in 0 days
(10 Reviews)
3.5
tgshakthi

HI, Have sent a working model , pls check pmb, Best regards, TG shakthi

$30 USD in 1 day
(5 Reviews)
3.5
IcepickD

Hi i can do this for you very fast. Check PM.

$30 USD in 1 day
(4 Reviews)
3.0
CheapGoodWork

hi lets start! Thank you!

$30 USD in 0 days
(2 Reviews)
2.7
karolisg

hi, check PMB

$50 USD in 1 day
(1 Review)
1.7
rohitag

Hi, Please check your PMB!!!

$45 USD in 0 days
(0 Reviews)
0.0
QuickCoder2011

Please check your PMB.

$30 USD in 0 days
(1 Review)
0.0
shubh1976

Hi Please See PMB

$50 USD in 0 days
(0 Reviews)
0.0
m2websolution

Please Check PM!!!

$45 USD in 1 day
(0 Reviews)
0.0