Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

How to pass Selected item Text to PHP from Javascript

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

How to pass Selected item Text to PHP from Javascript

Postby stephenrodrics » Fri Apr 05, 2013 6:41 am

I have implemented a feature where based on the Username selected, data should be retrieved from MYSQL database.

My question is how can i send Selected Username to my PHP class where all database operations are done from JAVASCRIPT function.

I have implemented OnClick function in javascript where i have the selected item name just i need some mechanism to pass that name to PHP where all database operations are done.

Can anyone tell how to do this
stephenrodrics
New php-forum User


Posts: 13
Joined: Thu Mar 14, 2013 6:10 am
stephenrodrics
New php-forum User
New php-forum User
 
Posts: 54
Joined: Thu Mar 14, 2013 6:10 am

Re: How to pass Selected item Text to PHP from Javascript

Postby seandisanti » Fri Apr 05, 2013 8:34 am

AJAX is the way to go. w3schools.com should give you a good headstart.
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 8 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron