innerHTML problem

Anonymous
timer Asked: Jul 17th, 2013
account_balance_wallet $5

Question Description

Hi to all. I have a task wich i show you in the end of message.
My problem is coming from innerHTML.
Under firefox and chrome everything is OK but when i start it under IE7 and above nothing happend.
This is my code :
this is in JS file:

function validate(param) {

if(param.length >=3) { ////show the parameter and check it for minimal lenght in the entry of the text field
var regex = /^(\d+)\-(\d+)$/i; // create regular expression that we use for our purposes
//var regex = /(\d+)(\.(\d+))*(\/(\d+))*-(\d+)$/ ;

var match = regex.exec(param);
if(match !== null) { //check if we have a coincidence
var select = generateSelecte(match[1], match[2]); //call the function with the two elemets, two numbers
if(select !== false) { //if we have some result
document.getElementById("mineSelect"). innerHTML = select; //in DOM we put the checkd result
}
}
else {
alert('The use value "'+param+'" is not valid');
}
}
else {
return false;
}
}
function generateSelecte(el1 , el2) {
   el1 = parseInt(el1);
   el2 = parseInt(el2);
   var DOMselect = '';  // empty string
   if(el1 < el2) { //when first number is lower we have positiv incrementation
     for(var k = el1; k <= el2; k++) {
       DOMselect = DOMselect + '<option value='+k+'>'+k+'</option>'; // на всеки елемент добавяме нов елемент оптионс за всяко въртене на цикъла
     }//on every element we add new options for every rotation in to the LOOP
     return DOMselect;
   }
   else if(el1 > el2) {
     for(var k = el1; k >= el2; k--) { //negative, subtrac 1
       DOMselect = DOMselect + '<option value='+k+'>'+k+'</option>';
     }
     return DOMselect;
   }
   else {
     return false;
   }
}


this is in HTML file
<html>
<head>
<title></title>
<script type="text/javascript" src="general.js"></script>

</head>
<body>

<div id="masterParent">

<div id="message"></div>
<form>

<input style="width:200px; height: 35px; line-height: 35px; color: green; border-radius: 3px; border: 1px solid silver;" type="text" id="inputText" name="cifri" placeholder="Please fill with mask 'dd-dd'" />
<span id='select'>
<select name="select4e" id="mineSelect">
<option>Please fill the require field</option>
</select>
</span>
<!-- When you click the button, he trigger onClick and call function 'validate' and take the result in tekst field -->
<input type="button" name="button" value="validate and set" onclick="validate(document.getElementById('inputText').value)" />
</form>
</div>

</body>
</html>

Tutor Answer

sana naz
School: Cornell University

you have to install new chrome from filehippo.com
may b its helpfull for you
thnx

flag Report DMCA
Review

Anonymous
Excellent job

Similar Questions
Hot Questions
Related Tags
Study Guides

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors