Forum Moderators: coopster
The idea is to have table of one row and three columns, like this:
¦ "image" ¦ [url box to image (http://.../.gif)] ¦ "submit image" ¦
where:
1. In the second column url address to image is input manually by user.
2. By pressing "submit image" (.gif button), data from the second column is altered in SQL table and simultaneously "image" in the first column is reloaded to new value, that was just input in SQL table.
The idea is to reload only "image" in the first column and not the whole page.
I believe that the "image" should be located in iFrame, but not sure. Can anyone give an example of such a magic "submit image" button, that will do all procedure required without reloading the whole page?
I know that onClick doesn't reload page, but can anybody give a JavaScript example, where SQL table is Altered by onClick, to do something like this:
array (<img src='.gif'> onClick=\"UPDATE Person SET FirstName = 'Nina' WHERE LastName = 'Rasmussen'"/);
Please note that this is WRONG!, non-functional example, just to give an idea of what I need.
Please help, if you can. Anybody?
As you probably know, in simplified terms OnClick performs some action once user clicked on desired ‘object’. See this for more in depth description:
[devguru.com ]
[javascriptkit.com ]
If I was solving your problem, I would define a function that handles your SQL stuff, and then just call it when needed, ie., something like this
function mysqlstuff() {
… sql code here…
}
<form>
<….. OnClick=”mysqlstuff()”>
</form>
below are links to few tutorials that you might find usefulel, however searching for”Javascript SQL” and/or “Javascript onclick SQL” yields bunch of useful results
[asp.net ]
[dotnetjunkies.com ]
HTH
Have a hidden form, use js to feed the query in the hidden input, and then use PHP to actually do the query at a later time.
As I say, I have no clue if this would work in your case.