aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Regading getElementById Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Regading getElementById" Watch "Regading getElementById" New topic
Author

Regading getElementById

priya pratheepp
Ranch Hand

Joined: Apr 02, 2008
Posts: 59
Hello friends

In my form I am using two things..one using AJAX and another using jquery.

Both are working fine...

Problem is both are displying in one place..I want to display it in different locations...

I used <div id="txtHintGrade"></div>
<div id="txtHint"></div>


txtHindGrade for first
document.getElementById("txtHindGrade").innerHTML=xmlHttp.responseText;
<span id=\"txtHindGrade\"></span>

and

txtHint for the second
document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
<span id=\"txtHint\"></span>


Both are displaying in one place where txtHint is given

please help

thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61769
    
  67

I'm not sure what it is you mean. If the spans are right near each other, and one is empty, the non-empty span will appear in the same place as the other would have.

You can use Firebug in Firefox to view the actual HTML element structure and see exactly what is happening with the HTML.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
priya pratheepp
Ranch Hand

Joined: Apr 02, 2008
Posts: 59
Thank you Bear

I opened in Firefox .I can't find any error message




when you select Staff_grade the combo box is displaying in the same place where empid is displaying...


thanks
[ May 14, 2008: Message edited by: priya pratheepp ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61769
    
  67

Originally posted by priya pratheepp:
I opened in Firefox .I can't find any error message

I didn't say anything about error messages. Using Firebug you can inspect the HTML structure after your code is executed and see which span the text has been added to.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Might be better to show the exact code so we can understand what you are talking about.

Eric
priya pratheepp
Ranch Hand

Joined: Apr 02, 2008
Posts: 59
In my form i have employee Id and grade.

When i type the employee id , if the id is already in database then it will be displayed near to employee id text box

When i select grade then all the grade above i selected should be displayed in next row of the table next to reporting to row...


for employee id




}For the grade drop down box
here i want to disply the drop down box





calling side



grading.js



Code:




thanks in advance
[ May 14, 2008: Message edited by: priya pratheepp ]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You can not have the same function name! When you repeat the function in the page, it overrides the first one. Change the second stateChanged function to a different name and set that new name to the onreadystatechange. Something more descriptive like stateChangedGrade would work.

Eric
priya pratheepp
Ranch Hand

Joined: Apr 02, 2008
Posts: 59
Hi Eric

You are really great .A thousand thanks to you......

Working fine....



Again thanks a lot
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Regading getElementById