JavaScript Dojo: TypeError: dojo.byId(…).attr is not a function

Weird, line one works fine but line 3 give me TypeError: dojo.byId(...).attr is not a function. There is hidden fields that hold all student pair that as <input type="hidden" id="_hidden_studentname_{somestudentid}" value="aStudentName">, here {somestudentid} only indicate it as student id variable. The purpose of this is try to get a student name by student id.

dojo.connect(dijit.byId('_studentId_id'), 'onChange', function (val) {
    var studentId=dijit.byId("_studentId_id").attr("value"); // line 1
    var id="_hidden_studentname_"+studentId;
    var studentName=dojo.byId(id).attr("value");             // line 3
    dojo.byId("_student_text").attr("value", studentName);
});

So dojo doesn't allow variable put in dojo.byId()? I am pretty sure the <input type="hidden"> with that id does exist....

Answer:1

I am attempting to run a script in a webpage, that should be executed in an <iframe>. Right now I can call a function that is set within the <iframe>.. I'm just having issues running a ...

I am attempting to run a script in a webpage, that should be executed in an <iframe>. Right now I can call a function that is set within the <iframe>.. I'm just having issues running a ...

  1. javascript iframe content
  2. javascript iframe contentwindow
  3. javascript iframe contentdocument
  4. javascript iframe contentdocument is null
  5. javascript iframe content height
  6. javascript iframe content loaded
  7. javascript iframe content change event
  8. javascript iframe content find
  9. javascript iframe contentwindow null
  10. javascript iframe content size
  11. javascript iframe contentwindow restricted
  12. javascript iframe content cross domain
  13. javascript iframe contentwindow postmessage
  14. javascript iframe content change
  15. javascript iframe contentwindow access denied
  16. javascript iframe contentdocument access denied
  17. javascript iframe contentwindow.document
  18. javascript iframe content height cross domain
  19. javascript iframe content type
  20. javascript iframe content parent

I started using html twig in Symfony2 and I got the following problem: function goEditConflict(){ $("#go").on("click", function(){ id = $("#case_number").val(); windows.location = {{ ...

I started using html twig in Symfony2 and I got the following problem: function goEditConflict(){ $("#go").on("click", function(){ id = $("#case_number").val(); windows.location = {{ ...

  1. parsing variable from javascript to php
  2. parsing variable in javascript
  3. parsing variable in java
  4. parsing parameters from url
  5. parsing variable in bash
  6. passing variable in sed
  7. passing variable in jquery
  8. passing variable in mysql
  9. passing variable in informatica
  10. parsing variable in xml

We used to be able to enter a search field, address on search box, hit the ENTER key on the keyboard and get the search results. I made several changes but can't pinpoint the change that resulted in ...

We used to be able to enter a search field, address on search box, hit the ENTER key on the keyboard and get the search results. I made several changes but can't pinpoint the change that resulted in ...

I made a code that should highlight searched string but it is not working. Here is the code: <body> <div>div is here</div> <div id="divid"> <div>this is a ...

I made a code that should highlight searched string but it is not working. Here is the code: <body> <div>div is here</div> <div id="divid"> <div>this is a ...

  1. select element with attribute
  2. select element with class
  3. select element with multiple classes
  4. select element with data attribute jquery
  5. select element with jquery
  6. select element with two classes
  7. select element with attribute jquery
  8. select element with javascript
  9. select element with text
  10. select element with class jquery
  11. select element with id css
  12. select element with child
  13. select element with class css
  14. select element with text css
  15. select element with two classes css
  16. select element with multiple classes css
  17. select element with id jquery
  18. select element with class javascript
  19. select element with data attribute javascript
  20. select element with id