Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Bit of an issue with XPath
Old 02-08-2008, 11:32 PM Bit of an issue with XPath
WaHoOoO!'s Avatar
Mentally Unstable Tugboat Captain

Posts: 797
Name: Chad
Location: /usr/bin/perl
Trades: 0
I've got the following code, but for some reason it always returns true. I'm trying to get the script to see if /all/ checkboxes on a page are selected. If true, enable a text box. If false, disable it. alerts() are there for debugging.

Code:
<script type="text/javascript">
function anyCheck() {
 var check = document.evaluate('//input[@type="checkbox" and not(@checked="checked")]', document, null, XPathResult.BOOLEAN_TYPE, null ).booleanValue;
 // document.getElementById('submit').disabled = true;
 if (check == true) {
    // document.getElementById('submit').disabled = false;
    alert ( 'True' );
 }
 if (check == false) {
    // document.getElementById('submit').disabled = true;
    alert ( 'False' );
 }
}</script>
__________________
He's baaaaaaaack....
WaHoOoO! is offline
Reply With Quote
View Public Profile Visit WaHoOoO!'s homepage!
 
 
Register now for full access!
Reply     « Reply to Bit of an issue with XPath
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.37920 seconds with 12 queries