I am having trouble with the following;
onClick="updateMysql()" calls getNextTelephone() onSuccess, this
returns the next telephone from a list and sets the global variable
globalTelephone with the new telephone number. The next onClick will
use displayNextTelephone() to change the telephone number with the
new one getNextTelephone() set the globalTelephone to previously. When
you click the button it gets and displays the next telephone from the
list. This works fine in Firefox but IE6 displays the first telephone
number and then nothing. When I reload the page with SHIFT it still
displays the first number. When I restart IE6 it gets the next number
but that is it.
Any help would be appreciated.
Thanks
Ken
<html>
<head>
<title>Example</title>
<script language="Javascript" src="includes/scripts/prototype/
prototype.js"></script>
<script language="javascript" type="text/javascript">
var globalTelephone = '';
function updateMysql() {
displayNextTelephone();
var url = "update_mysql.php";
new Ajax.Request(url, {
asynchronous: true,
method: "get",
onSuccess: function(request) {
getNextTelephone();
},
onFailure: function(request) {
alert('error');
}
});
}
function displayNextTelephone(){
$('telephone').value = globalTelephone;
}
function getNextTelephone(){
var url = "get_next_telephone.php";
new Ajax.Request(url, {
asynchronous: true,
method: "get",
onSuccess: function(request) {
results = request.responseText;
},
onFailure: function(request) {
alert('error');
}
});
globalTelephone = results;
}
</script>
</head>
<body>
<form action="post";
<p>
Telephone: <input type="text" size="10" id="telephone" />
</p>
<button type="button" name="button" onClick="updateMysql()"> Get Next
Telephone
</button>
</form>
</body>
</html>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---