• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What can I use to simplify the process?

#1
Code:
<textarea name="lists" rows="1" cols="20" id="list_2" onclick="doUpdate(this.value, this.id,this.name)">Medium $1.40</textarea>

And then doUpdate() brings up a prompt box, collects the new value from the prompt box (for example change Medium $1.40 to Medium $1.50), all other info and then makes an ajax call, which changes a relevant entry in the database.

As of now the html code above is hand coded. Ideally I would like a php function to query the database and then generate the html code. For example if id is list_X then it would be an li element. Im planning to do it when running a foreach loop.

Is there a simpler way of doing it? Ive never used json or xml - can I use them here and how? Thanks
Do the one thing you think you cannot do. Fail at it. Try again. Do better the second time. The only people who never tumble are those who never mount the high wire.
Reply

#2
create a html helper. json nor xml have nothing to do with this
Reply

#3
That's a good idea, thank you
Do the one thing you think you cannot do. Fail at it. Try again. Do better the second time. The only people who never tumble are those who never mount the high wire.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.