0

I have a dropdown, on its change I need to load the contents related to it on the same page. Which I did using jQuery. Now the question is how do I make edits on this data and store it on my database. If I am wrong in using jQuery for loading my data then what else should I use? I am using PHP as my server side scripting language.

More detail -

Simply taking there a list of details I need to display as per the country you select, which I am displaying currently in a nice grid(textboxes)!

Now the data from this grid should be copied to another textbox on "EDIT" button click from where I edit them and store it in my database. I am not able to make the values copy into a another textbox

2
  • The question is too short. Add more details. What kind of edits do you wand to do? When these edits should be performed? I guess changing the data from PHP is not a problem for you. So you just need to invoke such PHP code from your web page (e.g. using jQuery)... Commented Feb 19, 2015 at 7:36
  • I am not able to make the values copy into a another textbox Don't copy the data, just load the data similarly as you did it for your nice grid ... Commented Feb 23, 2015 at 20:49

1 Answer 1

0

You could do this:

  • Display the data in some form of editable div, textarea, or other element.
  • Make a hidden field somewhere and when you display the data
  • Set the row id from your database to the hidden field
  • On your change event, grab the id from the hidden field along with the edited data.
  • Using Jquery/ajax, send that data to a php page that will save thee data to your database using the passed in id.

You could do that.

However, if it were me (and if you're not married to your current databse / mySQL etc..), I would use parse.com. The service is free up to a significant amount of usage (which Ive never come close to) and it really simplifies everything. See the below post if you're interested in that approach:

Save and retrieve user input from database with javascript?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.