473,327 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

How to get the Absolute position of an HTML form Control Element using JavaScript?

I have an .htm page wwhich consits of a frame with 0 border,width and height

Now, when I enter a key,i.e onkeyup (keyboard pressing)event occurs, the form is submitted to asp.net page, which retrieves information and stores in a varriable.I use that asp.net varriable and using javascript in my .htm page and it works fine.

the Problem is that i want my data to be displayed right below the html textbox no matter what type of screen resolution is and regadless of what type of screen size, user is keeping in use.

as like below sketch

-----------------------------------------
Any Data that is written
-----------------------------------------
+++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++


Once again, When I press any key, the form gets submitted but the retrieved data does not gets listed exactly below that given text

for more precise vision please use google chrome's omini box.
when you press any key on keyboard, the results appera right under the search text


and please be notified that I have to use position:absolute; and the top:JavaScript-Given-Value property of CSS in may page

Anybody please help me with that.

Thank You verymuch in advance.
Apr 25 '13 #1
1 2566
johny10151981
1,059 1GB
read about offsetleft and offsettop.

and try this function


Expand|Select|Wrap|Line Numbers
  1. function getPosition(obj){
  2.     var topValue= 0,leftValue= 0;
  3.     while(obj){
  4.     leftValue+= obj.offsetLeft;
  5.     topValue+= obj.offsetTop;
  6.     obj= obj.offsetParent;
  7.     }
  8.     var position=new Object();
  9.     position.x = leftValue ;
  10.     position.y = topValue;
  11.     return position;
  12. }
Apr 27 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Adam Retter | last post by:
Hi Guys, I have a need to create a html form based on my schema. I initially decided to do this using xql, have got some way but am finding this difficult (it may be as I am very new to xql)....
10
by: Stephan Koser | last post by:
Hi, how can I get the absolute position of a relative element? We dynamically create a page with multiple segments which are relatively ordered among each other. In these segments we have...
1
by: subhashk | last post by:
Is it possible to create a editable HTML drop down list using javascript?
1
by: spree | last post by:
Hii everybody, here is my question I have values(for ex-username and password) in one html page. so after enters the values and clicks the submit button i am able to forward to next html page "...
1
by: shotokan99 | last post by:
on my page, i embedded wmp this way: <object id="mplayer" codebase=http://activex.microsoft.com/activex/ con... type=application/x-oleobject align=absmiddle classid=CLSID:22d6f312-b0f6-11......
1
by: Arpit Nagar | last post by:
Hi... I am creating a dummy project for collage. Here I had choosen my project as Jewelleryshoping. Now the scenerio is like that thier are jewellry item which I had display in table format with...
3
by: mkhizess | last post by:
Hi Buddzy Can you plz help to connect to Access DataBase input from HTML form using insert statement. I am still new on programming with html here is my code . <html> <head> ...
4
by: Ronald Raygun | last post by:
I have a form on an HTML page with the usual user name, email etc. I want to be able to display a popup window (callout?) when a text input control element is clicked. For example, for the form:...
9
by: OldBirdman | last post by:
I want to know the absolute position (Left & Top) of a textbox control on a form. Form may be Continuous or Single, may or may not have a Header, may be FullScreen or not, etc. I need this to...
2
by: puneetmca | last post by:
hi i want to insert employees DOB into database through html forms but my code is not working....only empty record is shown in the database in edob ..rest of the records are working...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.