Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regading getElementById

 
priya pratheepp
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64632
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
priya pratheepp
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64632
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Might be better to show the exact code so we can understand what you are talking about.

Eric
 
priya pratheepp
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Eric

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

Working fine....



Again thanks a lot
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic