Welcome Guest, Not a member yet? Register   Sign In
js param...
#1

[eluser]Unknown[/eluser]
Hi everybody,

I have a problem with this code below.
My syntax is incorrect because the js/Java plugin I use, need the exportMethod('param1') terms with single quotes before and after the param1...

Is there a way to make it work?

Code:
// Submit button
    $js = 'onClick="exportMethod('param1')"';
    $data_submit = array(
    'type' => 'Submit',
    'content' => 'Search this now!',
     );
        
    echo form_submit($data_submit, $js);

:-S

Best regards.

Jim.
#2

[eluser]danmontgomery[/eluser]
http://php.net/manual/en/language.types.string.php

Quote:To specify a literal single quote, escape it with a backslash (\). To specify a literal backslash, double it (\\). All other instances of backslash will be treated as a literal backslash: this means that the other escape sequences you might be used to, such as \r or \n, will be output literally as specified rather than having any special meaning.

Code:
'onClick="exportMethod(\'param1\')"';
#3

[eluser]Unknown[/eluser]
Thank you this is working.




Theme © iAndrew 2016 - Forum software by © MyBB