title: Passing values from text field to HTML canvas
body: <p>I'm looking to pass co-ordinates from a text field into HTML5 canvas. I'm using the code below to draw a rectangle on the canvas. The co-ordinates should be <code>0,0,50,50</code></p>
  
  <pre><code>function displayObject(currentObject){
      var imageNumber = $(currentObject).find('div.objectDd input.objectImageNum').val();
      var objectCoordinates = $(currentObject).find('div.objectDd input.objectCoordinates').val();
      var imageId = "";
      var canvasId = "";
      var context = "";
      var canvas = "";
  
  
      if(imageNumber != "" &amp;&amp; objectCoordinates != ""){
          imageId = "#imgNum".concat(imageNumber);
          canvasId = $('#objectData').find('#miImages '+imageId+' .imageContainer canvas').attr("id");
          canvas = document.getElementById(canvasId);
          context = canvas.getContext("2d");
          context.fillStyle = "#FF0000";
          context.fillRect(objectCoordinates);
      }
  }
  </code></pre>
  
  <p>I've tried passing them as a variable <code>objectCoordinates</code> but the rectangle is not drawn. </p>
  
  <p>How can I pass what the user enters as co-ordinates?</p>