biircoop Posted June 17, 2009 Share Posted June 17, 2009 I am having trouble parsing coding errors in my .php file. When I click on the first button, I want it to call two functions with the arguments specified. The first function is daily_hours() and the second is process_task() The current error that I am getting now is T_CONSTANT_ENCAPSED_STRING, but I have been messing around with it and changing it and have gotten many different errors. I think it might have something to do with how I am using quotes around my variables, but I can't figure it out. <input type=\"Button\" value=\"\" style=\"background-image:url(img/complete_task_btn.gif); border:0px; width:150px; height:30px; cursor:pointer;\" onclick=\"daily_hours(".$_REQUEST["ticket_id"].",".$_REQUEST["req_id"].","'".$dow."'","'".$status_id."'" ,"'".$last_log_hours_date."'","'".$weekday."'"); process_task(".$_REQUEST['ticket_id'].",".$_REQUEST['req_id'].",'".$_REQUEST['req_name']."','complete','".$_SESSION['username']."','".$_REQUEST['added_user']."')\"> Here is an example of the next button handler, which works fine on the function call, but doesn't have any variables other than the REQUESTS. <input type=\"Button\" value=\"\" style=\"background-image:url(img/cancel_task_btn.gif); border:0px; width:140px; height:30px; cursor:pointer;\" onclick=\"process_task(".$_REQUEST["ticket_id"].",".$_REQUEST["req_id"].",'".$_REQUEST["req_name"]."','cancel','".$_SESSION['username']."','".$_REQUEST['added_user']."')\"> Quote Link to comment https://forums.phpfreaks.com/topic/162652-onclick-handling/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.