Jump to content

ONCLICK HANDLING


biircoop

Recommended Posts

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']."')\">

Link to comment
https://forums.phpfreaks.com/topic/162652-onclick-handling/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.