Re: javascipt onclick in $html->image

2008-09-30 Thread ORCC

Double quotes should work too:

'on_click' => "open_win($id);"

On 30 sep, 10:37, bartez <[EMAIL PROTECTED]> wrote:
> Panic over
>
> answer is:
>
> 'onclick'=>'open_win('. $id .')'
>
> cheers
>
> a
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: javascipt onclick in $html->image

2008-09-30 Thread bartez

Panic over


answer is:

'onclick'=>'open_win('. $id .')'


cheers

a
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



javascipt onclick in $html->image

2008-09-30 Thread bartez

hey all,

This is really bugging me and i'm sure it's something that i'm not
doing.

my code is:

$id = $module['Module']['id'];
echo $form->input($module['Module']['refer_name'],
array(

'label'=>$module['Module']['title'].$html->image('1/
question.gif',
array(
'class'=>'question',

'onclick'=>'open_win($id)'
)),
'type'=>'checkbox',

'value'=>$module['Module']['price'],
'onclick'=>'addValue(this)'
));



This issue is with the onclick => open_win($id). it is not being
passed correctly. I have tried various combinations and they are as
follows:
(the code works fine if i pass a number through: open_win(1))

In this example, $id is equal to 2.


$id = blank, i.e it is defined but as blank
'$id' = error (unexpected T_VARIABLE)
"$id" = $id (not the value)
 = blank, i.e. it is defined but as blank
'' = error (unexpected '?')
"" =  not the value

Has anyone come across this before or has anyone got some pointers?

Cheers

alex
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---