•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 402,904 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,108 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 907 | Replies: 4
![]() |
•
•
Join Date: Aug 2004
Posts: 18
Reputation:
Rep Power: 5
Solved Threads: 0
Hi,
I am trying to create a 'simple' admin page where certain (authorized) people can update data in the database or add new info to it. The issue i've run into is after i created the form and have all the fields how do i tell which one(s) the user has typed into/edited so i can use that info in a query.
I was thinking i might need to use the onchange event but not sure how i'd track each field that was changed and then update only those, i even checked some of phpmyadmin's code to see how they do it but couldnt really figure it out.
Help plz
I am trying to create a 'simple' admin page where certain (authorized) people can update data in the database or add new info to it. The issue i've run into is after i created the form and have all the fields how do i tell which one(s) the user has typed into/edited so i can use that info in a query.
I was thinking i might need to use the onchange event but not sure how i'd track each field that was changed and then update only those, i even checked some of phpmyadmin's code to see how they do it but couldnt really figure it out.
Help plz
•
•
Join Date: Apr 2005
Location: New York state
Posts: 458
Reputation:
Rep Power: 5
Solved Threads: 68
•
•
Join Date: Aug 2004
Posts: 18
Reputation:
Rep Power: 5
Solved Threads: 0
well the thing is i'm not interacting with the database at this point. The 'fields' i'm referring to are the html form fields where a user would type things such as a name, etc.
e.g. If i had:
How do i tell which field the user has typed in here (sci name/com name or both) so that i can pass that text into a query later on.
e.g. If i had:
Search for a Plant to update: Scientific Name _____ Common Name _____ [search]
How do i tell which field the user has typed in here (sci name/com name or both) so that i can pass that text into a query later on.
•
•
Join Date: Apr 2005
Location: New York state
Posts: 458
Reputation:
Rep Power: 5
Solved Threads: 68
var blah = document.getElementById(<textbox id>);
if(blah.value == "")
alert("blah is empty"); GCS d- s+:+ a-->? C++(++++) UL+++ P+>+++ L+++ !E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r z+*
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r z+*
•
•
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation:
Rep Power: 8
Solved Threads: 239
You can just validate it through javascript(Or to check if that field has some value or not.) But, Its much easier if you do it in php. eg.
php Syntax (Toggle Plain Text)
if(isset($_POST['sci_name'])){ echo "Scientific name is ". $_POST['sci_name']; } if(isset($_POST['name'])){ echo "General name is ". $_POST['name']; }
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
*PM asking for help will be ignored*
*PM asking for help will be ignored*
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Previous Thread: HTML to PDF document
- Next Thread: JavaScript not working in Internet Explorer 7



Linear Mode