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 '’ k ”; // на всеки елемент добавяме нов елемент оптионс за всяко въртене на цикъла }//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 ” k ”; } return DOMselect; } else { return false; }}
this is in HTML file
<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'”
/>
Please fill the require field
<input type="button" name="button" value="validate and set"
onclick=”validate(document.getElementById(‘inputText’).value)” />