I have uploaded the latest jQuery library to my webspace.
On the jsFiddle preview site all three of my form enhancements are working properly, when I try to replicate these on my website only one of the features is working (in bold):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="http://mywebsite.com/scripts/jquery-1.7.1.js"></script>
<script type="text/javascript">
[B]$(document).ready(function() {
$("#bookingform").keydown(function(event) {
// Allow: backspace, delete, tab and escape
if (event.keyCode == 46 || event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 27 ||
// Allow: Ctrl+A
(event.keyCode == 65 && event.ctrlKey === true) ||
// Allow: home, end, left, right
(event.keyCode >= 35 && event.keyCode <= 39)) {
// let it happen, don't do anything
return;
}
else {
// Ensure that it is a number and stop the keypress
if ((event.keyCode < 48 || event.keyCode > 57) && (event.keyCode < 96 || event.keyCode > 105)) {
event.preventDefault();
alert("Numbers only (0-9), no spaces or other characters.")
}
}
});
});[/B]
String.prototype.ucfirst = function() {
return this.charAt(0).toUpperCase() + this.slice(1);
};
$('input, select', '#bookingform').bind('change keyup blur focus', function() {
$('#paxfullnumber').val(
$('#paxphonecode').val() + $('#paxphoneno').val().ucfirst());
});
$('#paxphoneno').bind('keypress', function(e) {
e.keyCode = e.which || e.keyCode;
if (e.keyCode == 48) {
alert("Please do not enter 0 as the first character")
}
});
</script>
</head>
<body>
<form name="bookingform" id="bookingform">
<p>Your phone number (main):</p>
<p><select name="paxphonecode" id="paxphonecode">
<option value="">...</option><option value="0044">United Kingdom (+44)</option>
</select><input type="text" name="paxphoneno" id="paxphoneno" /></p>
<p>Full number: <input type="text" name="paxfullnumber" id="paxfullnumber" /></p>
</form>
</body>
</html>
all features working: http://jsfiddle.net/YMs4q/70/
only one feature working: http://www.londonheathrowcars.com/bookings/testing1.asp
Can anybody assist me in trying to get all three features working on my webpage?
PLEASE! Have been trying to fix this for nearly 8 hours straight. Very novice jQuery user.
Thanks