Note that there are some explanatory texts on larger screens.

plurals
  1. POAdding inputbox to imgareaselect
    primarykey
    data
    text
    <p>I'm using imgAreaSelect by Odyniec.net to create a site with naming tag capabilities. </p> <p>The only part that I'm stumped on is adding a textbox for the user to add a name. Ideally, I would like to place a textbox underneath the user selected area.</p> <p><strong>Edit</strong>: Here is the entire page that I have so far. I can create the name tag and send the values, but I would like to have the box underneath the user selected area instead of the bottom of the image.</p> <pre><code>&lt;?php $x1 = $_REQUEST["x1"]; $y1 = $_REQUEST["y1"]; $x2 = $_REQUEST["x2"]; $y2 = $_REQUEST["y2"]; $name = $_REQUEST["name"]; $width = $x2 - $x1; $height = $y2 - $y1; $left = $x1; $top = $y1; if ($width &lt; 130){ $adj_width = ((120 - $width)/2); } else { $adj_width = $width; } ?&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;title&gt;Untitled Document&lt;/title&gt; &lt;link href="imgareaselect/css/imgareaselect-deprecated.css" rel="stylesheet" type="text/css" /&gt; &lt;style type="text/css"&gt; .circle { border-radius: 50%/50%; border: 8px solid white; opacity: .9; } .name { background-color: #FFF; border: 1px solid #CCC; width: 130px; margin-top: 5px; padding-top: 5px; padding-bottom: 5px; text-align:center; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;script src="js/jquery-1.8.3.min.js"&gt;&lt;/script&gt; &lt;script src="scripts/jquery.imgareaselect.pack.js"&gt;&lt;/script&gt; &lt;div id="container"&gt; &lt;div style='left:&lt;?php if($width &lt; 130){ echo $left - $adj_width . "px;"; } else { echo $left . "px;"; } ?&gt; top:&lt;?php echo $y1; ?&gt;px; position:fixed'&gt; &lt;table border="0" cellspacing="0" cellpadding="0"&gt; &lt;tr&gt; &lt;td align="center"&gt;&lt;div class="circle" style="height:&lt;?php echo $height; ?&gt;px; width:&lt;?php echo $width; ?&gt;px;" &gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td align="center"&gt;&lt;div class="name"&gt;&lt;?php echo $name; ?&gt;&lt;/div&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; &lt;img id="my_image" src="image.jpg" /&gt; &lt;/div&gt; &lt;form action="index.php" method="post"&gt; &lt;input type="hidden" name="x1" value="" /&gt; &lt;input type="hidden" name="y1" value="" /&gt; &lt;input type="hidden" name="x2" value="" /&gt; &lt;input type="hidden" name="y2" value="" /&gt; &lt;input type="text" name="name" value="" /&gt; &lt;input type="submit" name="submit" value="Submit" /&gt; &lt;/form&gt; &lt;script type="text/javascript"&gt; $(document).ready(function () { $('#my_image').imgAreaSelect({ aspectRatio: '4:4', handles: false, fadeSpeed: 400, onSelectEnd: function (img, selection) { $('input[name="x1"]').val(selection.x1); $('input[name="y1"]').val(selection.y1); $('input[name="x2"]').val(selection.x2); $('input[name="y2"]').val(selection.y2); } }); }); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload