Following on from some helpful advice on this forum, I have tried to develop a solution to a problem. Basically, when a user enters their bespoke widths into two seperate form fields (#input_9_2 and #input_9_3) I want an image or div layer, or table, to change shape in relation to the entered field entry. So if say, a user enters 20cm in field one and 300cm in field two, the image/div/cell will automatically before their eyes show that shape (using cm as pixels - this 20 px wide x 300px high). This is the code I have been using but it just isnb't working - I have no doubt my argument / syntax is wrong but can anyone help - I'm now three days into this and have tried very hard to sort myself. Many thanks.
-------
<img class="sbimg" id="sbimg" src="/wp-content/uploads/2012/06/AAF-Splashback-Black-Gloss-Splashback-Full-No-Handle-200x200.jpg">
<script>
$(function width(){
$('#input_9_2').keydown(function(){
setTimeout(function() {
$('#input_9_2').val();
}, 50);
});
});
$(function height(){
$('#input_9_3').keydown(function(){
setTimeout(function() {
$('#input_9_3').val();
}, 50);
});
});
var photo = document.getElementById('sbimg');
var photoWidth = width();
var photoHeight = height();
photo.width = photoWidth;
photo.height = photoHeight;
</script>