Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 28-11-2008
Member
 
Join Date: May 2008
Posts: 351
Unable to activate the control in IE6

I am quite surprised by the lack of solution on Google for my problem. I developed a calculator in php / jscript and inevitably it works on IE7 and Firefox 2 and so on, but 20% of Internet users are still on IE6. So I must also think about them.

So that's my problem:

Line 18
Error Unable to activate the control because it is either invisible or inactive

My question:

HTML Code:
<script type="text/javascript"> 
//<![ CDATA [ 
nbpages = 7; // number of tabs 
function page (npage) { 
list_tags = document.getElementById ("tabs").getElementsByTagName ("li"); 
for (i = 0; i < list_tags.length; i++) { 
list_tags[i].className = ""; 
} 
document.getElementById ( "tab" + npage). className = "active"; 
for (i = 1; i <= nbpages; i++) {
document.getElementById ("content" + i).className = "nonactive"; 
} 
page_elt = document.getElementById ("content" + npage); 
page_elt.className = "active"; 
if (page_elt.getElementsByTagName ("input") [0]! = null) { 
page_elt.getElementsByTagName ("input") [0]. focus (); 
page_elt.getElementsByTagName ("input") [0]. select (); 
} 
} 
//]]> 
</script>
Reply With Quote
  #2  
Old 28-11-2008
Member
 
Join Date: May 2008
Posts: 945
Re: Unable to activate the control in IE6

I think let us see which triggered the error. Try to attach an event on an object which are not or can not receive this kind of method

Code:
if (page_elt.getElementsByTagName ("input") [0]) && window.XMLHttpRequest)
which should work equally well
Reply With Quote
  #3  
Old 28-11-2008
Member
 
Join Date: May 2008
Posts: 351
Re: Unable to activate the control in IE6

When I place an alert (page_elt.getElementsByTagName ("input") [0]) before the condition, on IE6 I [Object] and on Firefox I [Object HTMLInputElement].


Otherwise, I have another little problem controlling my entry form (always with IE6 and then IE7, Firefox ok).

Code:
function validate (champtest) { 
var number = document.getElementById (champtest). value; 
if (!isNaN (number)) 
{
alert ( 'ok'); 
}
else 
{
alert ( "The seizure is not a number!"); 
document.getElementById (champtest). value = 0; 
}
return false; 
}
Field tested example:

HTML Code:
<input name = "param2x15" id = "param2x15" value ="<?= variable ( "param2x15");?>" size = "8" onchange = "confirm ('param2x17') return false;"/>
symptom: on IE6, I can no longer go on another field, the alert comes whenever I go elsewhere, while it works in IE7 and Firefox.

Thank you again.
Reply With Quote
  #4  
Old 28-11-2008
Member
 
Join Date: May 2008
Posts: 945
Re: Unable to activate the control in IE6

For the first part it means that the error is not the code that you have shown. Use a real debugger.

http://blogs.msdn.com/ie/archive/2004/10/26/247912.aspx

Just check whether is selected. If not then do check it and submit. You can also try with onkeypress.
Reply With Quote
  #5  
Old 28-11-2008
Member
 
Join Date: May 2008
Posts: 351
Re: Unable to activate the control in IE6

Field tested:

HTML Code:
<input name = "param2x15" id = "param2x15" value ="<?= variable ( "param2x15");?>" size = "8" onchange = "confirm ('param2x15') return false;"/>
javascript:

Code:
function validate (champtest) {
var number = document.getElementById (champtest).value; 
if (!isNaN (number)) 
{
document.getElementById (champtest).value = document.getElementById (champtest).value; 
}
else 
{
alert ("The seizure is not a number!"); 
document.getElementById (champtest).value = 0; 
}
return false; 
}
it works with all browsers except IE as I press the TAB to move to the next field. With onkeypress is worse, I can not write anything at all.
Reply With Quote
  #6  
Old 28-11-2008
Member
 
Join Date: May 2008
Posts: 945
Re: Unable to activate the control in IE6

ok I misunderstood. You want to launch validation when you get out of the field and not when the changes

HTML Code:
<input type = "text" name = "param2x15" id = "param2x15" value ="<?= variable ("param2x15");?>" size = "8" onchange = "validate (this.value,this.id);"/>
Code:
function validate (val,id) {
if (isNaN (val)) {
alert ( "The seizure is not a number!"); 
document. getElementById (id). value = 0; 
}
}
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Unable to activate the control in IE6"
Thread Thread Starter Forum Replies Last Post
Unable to activate iOS 6 Beta messi-m Portable Devices 3 12-07-2012 11:51 AM
Unable to activate Dragon Age 2 Itachi Uchiha Video Games 5 15-03-2011 10:22 AM
Unable to activate Windows firewall Triple-X Networking & Security 5 24-12-2009 06:04 PM
Unable to activate windows 7 piyush chavla Operating Systems 5 08-12-2009 08:37 AM
Unable to activate a function through C# Solaris Software Development 3 24-09-2009 09:47 AM


All times are GMT +5.5. The time now is 09:36 PM.