Mangalaganesh Balasubramanian wrote:
Hi,
This is my requirement & i woudl arppreciate any assistance on this.
I ahve a scanned form which has data entered by User.
I want to have a web page which woudl display this scanned form as a
top part (a frame) and the second frame (bottom part) woudl be a HTML
Form.
Using JS when i am on a particular text field say account number, i
want the image at the top to show only the account number section of
hte image (which is @ a known co-ordinate)
Appreciate any assistnace and pointers
First put your scanned image inside a named and styled <div>
<div id='scannedImage' class='imageClass'><img
"somegiantscannedimage.png"></div>
Next set up a CSS style.
..imageClass {
position: absolute;
}
The position MUST be absolute or none of this will work.
Next in your javascript code set the starting .left and .top elements...
document.getElementById('scannedImage').style.top= 0px;
document.getElementById('scannedImage').style.left =0px;
And then finally the command which will let you do what you want to do..
document.getElementById('scannedImage').style.clip ='rect("0px, 1000px,
1000px, 0px")';
clip basically clips a rectangle from your division and shows only the
coordinates expressed in rect. The values of rect correspond to (top,
right, bottom, left) in that order. By creating clips and then altering
style.top and style.left you can create a rectangle of any size you want
showing any spot on in the division.
You'll have to fiddle around with it but just changing the values and
seeing how that affects what you see in the web page will get you up to
speed at a fairly good clip (heh).
Good luck.
>
Manglu
--
---------------------------------------------------------------------------
http://www.hunlock.com -- Permanently under construction (And proud of it!)
$FA