Hi

I have two issues on JsHelper.
Could someone help me, please?

1) The key "data" in $options parameter of "request" function outputs
a javascript code between quotes. So when I use something like data =>
$js->get("#myForm")->
serializeForm() it doesn't work. In "submit" function the data
parameter is right, but it also happens in "link" function. Is there
any mistake in my use?


Example:

This code:

echo $js->submit( "Submit button", array( "url" => "/controller1/
action1", "update" => "#myDiv" ) );

Results in this javascript code:

$("#submit-1111709077").bind("click", function (event) {$.ajax({data:$
("#submit-1111709077").closest("form").serialize() ...

While these:

echo $js->link( "my link", "/controller1/action1", "update" =>
"#myDiv", "data" => $js->serializeForm( array( "isForm" => true,
"inline" => true ) ) );
echo $js->request( "/controller1/action1", array( "update" =>
"#myDiv", "data" => $js->serializeForm() ) );

Result in these:

... $.ajax( {data:"$(\"#myForm\").serialize()" }
... $.ajax({data:$("#link-1111709077").closest("form").serialize() ...



2) Strings in javascript code are always written between double quotes
as the html tag attributes. When something like this "'onclick' => $js-
>request..." is used in a htmlAttributes array, the quotes remain
unpaired. Is there any configuration to use single quotes instead of
double quotes?



Thanks!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to