...

View Full Version : onclick event handlers



drew_uk
03-01-2012, 11:52 AM
hi,
i need to be able to take the values from two text boxes and change the location of a sprite on my canvas, i've searched the internet and it doesnt really explain how to do it for me. here is my code:

x: <input type="text" name="x" id="x"/><br />
y: <input type="text" name:"y" id="y"/><br />
<input type="submit" value="Submit" onClick="ChangeCo()" /><br />

function ChangeCo()
{
}

and i need the function to take the x and y values from the text boxes and change the values of my variables:

var block_x;
var block_y;


block_x = 290;
block_y = 70;

Thankyou in advance

Philip M
03-01-2012, 12:27 PM
Double-posted! http://www.codingforums.com/showthread.php?t=253011 :(

drew_uk
03-01-2012, 12:30 PM
oh sorry, but my second one was more specific as the first one i didnt know i needed an onclick event handler, so i posted again to find out how they worked thats all

VIPStephan
03-01-2012, 12:59 PM
oh sorry, but my second one was more specific as the first one i didnt know i needed an onclick event handler, so i posted again to find out how they worked thats all

You can just update/continue your current thread with the new question as it relates to the subject.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum