• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Regading getElementById

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67650
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67650
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Eric

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

Working fine....



Again thanks a lot
 
reply
    Bookmark Topic Watch Topic
  • New Topic