Guys,
I want to access all the <div> tags on my page. below is javascript
which is use to access them
var divs=document.getElementsByTagName("div");
this works on IE but is failing on Pocket PC 2003 browser.
any of guys faced this problem..any work arounds?
thanks for the help
Martin Honnen - 30 May 2005 15:47 GMT
> I want to access all the <div> tags on my page. below is javascript
> which is use to access them
[quoted text clipped - 3 lines]
>
> any of guys faced this problem..any work arounds?
I guess
var divs = document.all.tags("div")
will do. But that is just a guess I have no pocket pc here to test.

Signature
Martin Honnen
http://JavaScript.FAQTs.com/
vinodbijlani@gmail.com - 30 May 2005 16:53 GMT
thanks Martin.
i got a feeling tht PPC 2003 has different IE version.. checked the
User-Agent & it is IE 4.01..
but still document.all.tags("div") is failing ..tried with CAPS
..fails (this should have worked with IE 4)
will try the id way suggested by VK...
any other suggestions
appreciate the help
vinodbijlani@gmail.com - 30 May 2005 16:56 GMT
i m just using the emulator
http://www.microsoft.com/downloads/details.aspx?FamilyID=5c53e3b5-f2a2-47d7-a41d
-825fd68ebb6c&DisplayLang=en
yet to try on real pda ..seems like its goin to be fun
VK - 30 May 2005 16:43 GMT
On Pocket Internet Explorer you can use only directly addressed div's:
<div id="div1"></div>
and later:
div1.innerHTML = "New content";
You have no evident way to get it by id or from a collection.
Actually all pocket browsers is a fancy mixture of IE 3.0, JavaScript
1.0, some (VERY some) DHTML, a bit of CSS and ALWAYS a pretty good XML
parser.
If you really want to program for PDA's, you have a choice: either use
the forgotten lore of all these tricks for 3rd browsers, or program
directly with XML Island.
vinodbijlani@gmail.com - 30 May 2005 17:00 GMT
Vk,
these div are built dynamically.
its basically a Question & Answer page (dynamic generation) answers are
radio buttons & checkbox. I need to build the URL to submit the
questions & selected answers for the next page
thanks
vinodbijlani@gmail.com - 30 May 2005 17:04 GMT
FYI,
even this doesnt work
var e1 = document.all[0];
alert(e1);
VK - 30 May 2005 20:19 GMT
> even this doesnt work var e1 = document.all[0];
As I told you :-). I have Pocket PC's for 6 year now.
This work though:
...
<div id="que1"></div>
...
que1.innerHTML = newQuestion;
No custom arrays of any kind, sorry (JavaScript 1.0)
You can use native anchors array instead of <div> to hold
question/answers/right answer info:
<a name="Answer1_Answer_2_Answer_3_RightAnswer">Question</a>
and later document.anchors[i].name and string functions to extract the
right part.
Or better to use a data island <xml>data</xml>
vinodbijlani@gmail.com - 30 May 2005 21:11 GMT
VK
thanks for ur reply.
sorry i m not very conversent with data island. how do i use data
island for user input??
radio button ..check box?? can i?
thanks again
vinodbijlani@gmail.com - 31 May 2005 02:38 GMT
thanks for the help guys. fixed the problem. below is the javascript .
form.elements works just fine PPC 2003.
var j = 0;
var radio_buttons = new Array();
var radio_buttonnames = new Array();
for(var i=0; i<questionForm.length; i++){
var temp = questionForm.elements[i].type;
if((temp == "radio") && (questionForm.elements[i].checked)) {
radio_buttonnames[j] = questionForm.elements[i].name;
radio_buttons[j] = questionForm.elements[i].value;
j++;
}
}
alert("created arrays");
for(var k=0; k<radio_buttons.length; k++){
qId=radio_buttonnames[k];
answerId=radio_buttons[k];
queryString=queryString+"responseQuestionId_"+qId+"="+qId+"&responseAnswerId_"+qId+"="+answerId+"&";
}
alert(queryString);