The_Monster
The_Monster

Reputation: 510

Check if code is compatible with IE 5

I have to make a website that is compatible with IE 5+, It has to work with IE5+ because the device im working with uses Windows CE 5 or 6 and i cannot update the IE to a more recent version.

I've made a javascript code with a couple of functions:

GiveFocus()

This function assigns the focus to the first textfield when the page is loaded. I know this function works.

CheckOne()
CheckTwo()

These functions are assigned to the textfield with an OnKeyUp() When key 13 is pressed, (for those who do not know key 13 its the enter key) It gives the focus to the next field. These functions also work to a extend.

When the page comes to the final component it skips the focus to the URL bar of the browser

SubmitForm()

This is the function im worried about, In this function i have a check if the textfields arent empty, If those fields aren't empty the value are given to other textfiels and the form will be submitted. I'm worried the browser wont be compatible with this code.

The code looks like this:

function SubmitForm()
{
    var locatie = document.getElementById("one").value;
    var bonregel= document.getElementById("two").value;

    if (locatie.length == 0)
    {
        ErrorMessage("Het locatieveld is niet ingevuld");
    }
    if (bonregel.length == 0) {
        ErrorMessage("Het bonregelveld is niet ingevuld");
    }
    if (bonregel.length == 0 & locatie.length == 0)
    {
         ErrorMessage("Geen velden ingevuld");
    }
    else {
        document.getElementById("locatie").value = locatie;
        document.getElementById("bonregel").value = bonregel;
        document.myform.submit();
    }
}

function ErrorMessage(Message)
{
    document.getElementById("errorSection").innerHTML = Message;
}

And this is the html the code has to work with:

<form name="myform" action="/" method="post" >  
    <input type="hidden" id="locatie" name="locatie" />
    <input type="hidden" id="bonregel" name="bonregel" />           
</form>         
<table>
    <tr>
        <td>Locatie:</td>
        <td><input type="text" id="one" onkeyup="CheckOne()" name="locatie" value="{locatie}" /></td>
    </tr>
    <tr>
        <td>Bonregel:</td>
        <td><input type="text" name="bonregel" id="two" onkeyup="CheckTwo()" /></td>
    </tr>
</table>

<p id="errorSection">{errorSection}</p>

So the conclusion, Will the code work? And will it work with IE5+ because i cant test it on the device because i dont have it yet.

Or is there a way to get IE5 so i can test it on my computer?

Upvotes: 2

Views: 1211

Answers (2)

kolin
kolin

Reputation: 2344

Internet Explorer 11 Devtools seems to let you select IE5 (shudders) as a mode option if that is of any help whatsoever.

How accurately it resembles a 15yr old browser though is up for debate.

this may help : http://tredosoft.com/Multiple_IE

Its a collection of old IE versions, although whether they'll install sidebyside on a modern OS I don't know.

Upvotes: 2

Tschallacka
Tschallacka

Reputation: 28742

blastfromthepast o_O I would suggest you find an win98 cd and try it out.

If it doesn't work, use document.all['id'] or document.forms[index].elements[index]

Thats how I did it back in the netscape days. When you used document.all to test if a browser was IE

Upvotes: 1

Related Questions