Home>
In the jQuery written in the php file, PHP is written as follows.
I want to use jQuery variables in that PHP, what should I do?
Please professor.
When I try the code below, I get an error like this:
Undefined variable: value
Below in jQuery
{{Common :: getData (Config :: get ('const.PrefecturesList'), $value)}}
I'm writing php, and I want to use the value defined in js for the $value part.
It doesn't work. ..
$("select [name * ='japan_region']"). change (function () {
var id = $(this) .attr ('id');
var value = $(this) .val ();
$("select [name ='japan. {$id} .japan_prefectures']"). val ('(['' =>'Please select a prefecture']] + {{Common :: getData (Config: : get ('const.PrefecturesList'), $value)}})');
-
Answer # 1
Related articles
- php - please tell me about the availability of variables in the mysql command (update syntax)
- php - about wordpress and javascript jquery
- php - [jquery] about ajax communication outside the management screen
- about webphp and apiphp when using vuejs with laravel
- about encryption at the time of output in php using form input tyle = "password"
- php - about sqlstate [hy093]
- php - i can't connect to the db using pdo
- php - using preg_match with the same character does not result in a partial match
- php - about laravel 8x components
- ruby - passing variables using render partial
- php - about compiling javascript code in laravel development
- i want to save data in phpmyadmin using insert syntax
- about data race of shared variables in c language threads
- php - [laravel] about the return type of the helper function view ()
- cakephp/crud: about query parameter value retrieval
- python - about errors when using the camera module of raspberry pie
- php - about bookmark function on the web
- about the code using the c language sleep function
- nodejs - about communication using express and socketio
Related questions
- php - i am making a customer search system by studying, but i want to be able to connect to a database, but it does not work
- javascript - how to get multiple jquiry radio button values
- javascript - buttons that scale the entire page do not work
- javascript - [html/css] the inverted triangle mark in the select box is overwritten on the background
- php - about passing through without com with input [type = email]
- php - the value cannot be retained when the quantity of the shopping cart is changed by select/option
- html - i want to display the "+" and "-" of the content that opens and closes the anchor link and accordion
- php security measures (validation) question about validation of input elements on the server side
- php - i want to be able to appear by clicking the drop-down menu that appears when hovering
I'm probably writing Laravel, so I'm assuming you're using a Blade template
&
{{Common :: getData (Config :: get ('const.PrefecturesList'), $value)}}
Is assumed to be the part described in BladePHP (blade) template processes PHP on the server and returns the result (HTML data) to the client
JavaScript is described in HTML data
JavaScript
It is processed based on the source of.Since it is independent, JavaScript variables cannot be used in PHP.
To use it like that
ajax
Using etc.JavaScript
Pass the variable of to PHP and get the resultJavaScript
It will be processed with.