Tuesday, September 16, 2014

Re: From JQuery (a hidden field value) to PHP

$(document).ready(function() {
var hiddenField = $("#hiddenField").attr("value");
alert(hiddenField);
});

Andras Kende


On Sep 16, 2014, at 10:20 AM, Cengiz Tuerkoglu <cengiz.tuerkoglu@googlemail.com> wrote:

> Dear Experts,
>
> is it possible to read a value of a hidden field with JQuery within the PHP code?
>
> Here what I'm going to do:
>
> <input type="hidden" id="hiddenField" value="eng" />
>
> <?php echo $this->Html->link('MyLink', array('controller' => 'MyController'); ?>
>
> Because I need the users (locale) language saved as value of the hidden field, I wont pass this to the controller definition like "array('eng/controller' ...)"
>
> Thanks and Cheers,
> Cengiz
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/d/optout.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: