I'm not sure I follow. I get the impression your trying to use
javascript **within** your php code.

PHP is a server side language. This means that it does ALL of its
processing before the user see anything. (Except for special cases
where output is a stream or iterative)

JavaScript is a client side language. This means it runs only after
ALL the output from the server has been received.


What that all means is that $html->link has completed and passed the
resulting text to your browser long before any JS on that page
executes....So you can't do that.  Not to mention that the PHP code
also runs before a user checks any boxes(or sees them for that
matter)...

You can only write javascript to act on the html code of the page (or
the resulting http://mysite.com/cake_generated/links).

So to hack this you might just let PHP output a unique keyword to be
replaced later("CONCAT_URL"). THan you can use some javascript to act
on the innerHTML of the containing class and use a string replace to
input your variable (replace "CONCAT_URL" with "" + var1 + var2.)

Someone else might have a better solution, but I go back to my main
point. You can't use javascript within PHP.



On Dec 22, 8:12 am, Chizo <[email protected]> wrote:
> hi, i need a litle help. I need to pass a paremeter to an action, that
> parameter contains a string with the concatenation of the value of the
> selected checkbox that i have in list (the index.ctp list).
> I have a javascript function that returns that value. How can  i pass
> that returned value to the action via $html->link? in the second array
> of the link i need to put the javascript returned value... but how can
> i do that?
>
> <?php echo $html->link('Borrar seleccion', array
> ('action'=>'delete'),null, sprintf(__('Are you sure you want to
> delete?', true),' ')); ?>
>
> pd: i´m not using ajax, and the best way to do this is via post or
> get??
>
> Thanks!!!!
> Lucas
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to