Hello. I'm encountering an out of memory error with a script.
The script, which follows, is being called from the onclick of a
button. If I comment out the call to F1.Data.Validate, then everything
works properly sans the validation. I'm calling the same validation
code without error elsewhere, so I'm not sure what the issue is. Any
ideas?
F1.Security.SendReminder = function() {
var emailAddress = $F('txtEmail');
if (F1.Data.Validate(emailAddress,'Email','reminderresult')) {
var results = $("reminderresult");
results.update('');
new Ajax.Request("callfunction.afp?SendReminder",
{
method:'post', parameters:
$('ReminderForm').serialize(),
onSuccess: function(transport)
{
results.update(transport.responseText)
},
onFailure: function()
{
alert('Login failed to contact the
server. Please try again...')
}
});
}
}
The other scripts that are called are as follows:
F1.Data.Validate = function(ControlOrValue, options, errordisplay) {
var validators = options.split(',');
for (var i=0;i<=validators.length-1;i++)
{
var fnName = 'F1.Data.Validate.'+validators[i]
if (typeof eval(fnName) == 'function') {
var testValue = (typeof ControlOrValue=='object')?
ControlOrValue.value:ControlOrValue;
var valid = eval(fnName+'(testValue)');
if (valid==false) {
F1.Data.Validate.ShowError(errordisplay);
if (typeof ControlOrValue == 'object') {
ControlOrValue.focus();
}
}
else {
F1.Data.Validate.ClearError(errordisplay);
}
}
}
}
F1.Data.Validate.ShowError = function(errordisplay) {
if (typeof errordisplay=='string') {
$(errordisplay).update('<p
class="formerror">'+F1.Data.Validate.ErrorMessage+'</p>');
}
else {
alert(F1.Data.Validate.ErrorMessage);
}
}
F1.Data.Validate.ClearError = function(errordisplay) {
if (typeof errordisplay=='string') {
$(errordisplay).update('');
}
else {
alert(F1.Data.Validate.ErrorMessage);
}
}
F1.Data.Validate.Email = function(testValue) {
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]
{2,4})+$/;
if (!filter.test(testValue)) {
F1.Data.Validate.ErrorMessage = testValue + ' is not a valid
email
address.';
return false;
}
else {
return true;
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" 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/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---