/    Sign up×
Community /Pin to ProfileBookmark

automated ; after 2 numbers cross-browser

Hello, I have a script where people can fill in there hours and that it wil be transferd to the database. What i want is that every time they fill in 2 numbers a ; appears after the 2 numbers. I got it al working for internet explorer, but can you help me with crossbrowsing it.
the script is as follow.

[code=html]
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xml:lang=”en” lang=”en” xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<meta http-equiv=”MSThemeCompatible” content=”no” />
<title>e-UUR urenregistratie</title>

<link href=”styles/calendar.css” rel=”stylesheet” type=”text/css” />
<script type=”text/javascript” src=”javascript/functions.js”></script><script type=”text/javascript” src=”javascript/ajax.js”></script><script type=”text/javascript” src=”javascript/calendar.js”></script>
<link href=”styles/styles_timecard_msie.css” rel=”stylesheet” type=”text/css” />
<script TYPE=”text/javascript”>

// copyright 1999 Idocs, Inc. http://www.idocs.com
// Distribute this script freely but keep this notice in place
function numbersonly(myfield, e, dec)
{
var key;
var keychar;

if (window.event)
key = window.event.keyCode;
else if (e)
key = e.which;
else
return true;
keychar = String.fromCharCode(key);

// control keys
if ((key==null) || (key==0) || (key==8) ||
(key==9) || (key==13) || (key==27) )
return true;

// numbers
else if (((“0123456789”).indexOf(keychar) > -1))
return true;

// decimal point jump
else if (dec && (keychar == “.”))
{
myfield.form.elements[dec].focus();
return false;
}
else
return false;

}
function puntjes(x){
var y=document.getElementById(x).value
if(y.length == 2 && event.keyCode!=8){
document.getElementById(x).value = y.substr(0,2)+”:”
}
}
</script>
</head>
<body onload=”createEvents();”>
<table class=”root”>
<tr>
<td style=”height:100%; _height:;”>
<table class=”container”>
<tr>
<td class=”header” colspan=”3″>
</td>

</tr>
<tr>
<td class=”menu”>
</td>
<td class=”main” rowspan=”2″>
<div class=”main_div”>
<table style=”height:100%; “><tr><td>
<!– begin sorteerform –>

<form name=”sorting” method=”post” action=””>

<input type=”hidden” name=”sortOn” id=”sortOn” value=”” />

<input type=”hidden” name=”term” id=”term” value=”<?php echo $term ?>” />

<input type=”hidden” name=”offset” id=”offset” value=”<?php echo $offset ?>” />

</form>

<!– einde sorteerform –>
<!– begin berichten –>

<?php

$loop = 0;

while (isset($messages[$loop][‘type’])) {

if ($messages[$loop][‘type’] == ‘info’) {

?>

<div class=”error_melding”><img src=”images/ok.gif” alt=”” title=”Info” /> &nbsp;<?php echo $messages[$loop][‘message’] ?><br /></div>

<?php } else { ?>

<div class=”error_melding”><img src=”images/error.gif” alt=”” title=”Fout” /> &nbsp;<?php echo $messages[$loop][‘message’] ?><br /></div>

<?php

}

$loop++;

}

?>

<!– einde berichten –>

<?php include($template); ?>
</td></tr></table>
</div>
</td>
<td class=”side”>
&nbsp;&nbsp;&nbsp;&nbsp;
</td>
</tr>
<tr>
<td class=”menu_onder”>
&nbsp;
</td>

<td class=”side_onder”>
&nbsp;
</td>
</tr>
<tr>
<td class=”footer_left”></td>
<td class=”footer_middle”>
<img src=”images/direktlogo_timecard.png” style=”float:left; margin:2px;”></img>
<span>
<strong>Hoofdkantoor Direkt Uitzendbureau:</strong><br />Essebaan 73 – 2908 LJ Capelle aan den IJssel – Telnr.: 010-4584022 – Faxnr: 010-4584724 – E-mailadres: [email protected]</span>
</td>
<td class=”footer_right” >
&nbsp;
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>

[/code]

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @robertozippit spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...