skip to Main Content

When I try to pass variables to check_holiday_dates_on_application I want them to be surrounded by ‘ in the site html. This is what my code looks like:

'onchange' => 'return check_holiday_dates_on_application('' . $this->Url->webroot('') . '', '' . $token . '',' . json_encode($abstractionDayList) . '');']); ?>

What I want is

onchange="return check_holiday_dates_on_application('webroot',token','abstractionDayList');"

What I get is

onchange="return check_holiday_dates_on_application('webroot', 'token',abstractionDayList');"

Can anyone help me out?

2

Answers


  1. Chosen as BEST ANSWER

    Worked with setting the parameter

    'escape' => false
    

    Thanks for the answer @Greg Schmidt in the comments.


  2. Try this, hope it helps

    'onchange' => "return check_holiday_dates_on_application('" . h($this->Url->webroot('')) . "', '" . h($token) . "', " . json_encode($abstractionDayList) . ");"
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search