php - Populate html textbox with Javascript canvas data -


i have canvas couple of images in it, use following code width , height of image when click on image:

canvas.addeventlistener('click', function (e) {    var mouse = mystate.getmouse(e);     var mx = mouse.x;     var = mouse.y;     var shapes = mystate.shapes;     var l = shapes.length;     (var = l-1; >= 0; i--) {       if (shapes[i].contains(mx, my)) {         var mysel = shapes[i];         mystate.selection = mysel;         mystate.valid = false;             var message = 'image width*height = ' + mysel.w + '*' + mysel.h;     alert(message);         return;       }     } 

and have simple html text boxes this:

width:<input type="text" id="width" size="10"> height:<input type="text" id="height" size="10"> 

is possible somehow populate textboxes width , height when click on image? there maybe way put width , height php variable , put value in textbox? haven't got experience javascript don't know if possible or not.

if push me in right direction or maybe provide example or usefull link great!

assuming click event width , height of image simple adding this:

document.getelementbyid('width').value = mysel.w; document.getelementbyid('height').value = mysel.h; 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -