Hi, I have some custom javascript that I am calling before the Save button submits the form to be saved.
However, for some strange reason, it only directs me to a page that says this:
Fatal error: Cannot redeclare class PHPMailer in ../include/phpmailer/class.phpmailer.php on line 21
And it never saves the information. What is strange is that I know I have been able to do this before. I just can't find the code that I used before and it's driving me nuts!
Anyone know what I might be missing here?
Here is the button (in editviewdefs.php file):
Notice how in the onclick event I have it calling my own function called check_save() before the check_form() event gets passed. This check_save function works perfectly with no problems. It checks to make sure that the assigned user is not the currently logged in user when saving on a certain module. No problems there.PHP Code:'form' => array(
'buttons' => array(
array('customCode'=>'<input id="samples_transfer_save" type="submit" value="Save Transfer" name="button" onclick="this.form.action.value=\'Save\'; return (check_save() && check_form(\'EditView\'));" class="button" accesskey="S" title="Save [Alt+S]"/> '),
'CANCEL',
),),
Here is the javascript code for check_save():
Again, this code works fine. If you are currently logged in as Admin, and try and assign this particualr record to admin, it will display the warning above (obviously, I am using a little jquery to help out).Code:function check_save() { if(document.getElementById('assigned_user_id').value == '{{$current_id}}') { document.getElementById('warning').innerHTML = 'Error: Explanation of error'; $j("#warning").fadeIn("slow"); setTimeout('$j("#warning").fadeOut("slow");',20000); return false; }else { return true; } }
However, then I change the assigned user to a different user (which will bypass the if/else statement in the javascript to just return true) and then it brings me to a page that just says the error message about Cannot redeclare class PHPMailer.
Can anyone help me out with this? I know it's going to be something easy and that I have just been staying up too late programming!
Thanks!


LinkBack URL
About LinkBacks




Reply With Quote
Bookmarks