JQuery (UI): Javascript Variable convert to PHP Variable -


first of all.. possible? work&create var in javascript (jquery ui framework) , when click on "submit" button of form should variable?

html & javascript (jquery ui):

<script>        $(document).ready(function() {  var slider1 = $( "#slider1" ).slider( "value" ); var slider2 = $( "#slider2" ).slider( "value" );       }); </script> 

pseudo: html & php:

<?php echo slider1 ?> 

how can echo value of #slider1 ??

you cannot assign variable javascript php, can set javascript variable form input element before send form, can values via $_post or $_get (or $_request) superglobal arrays, based on method ().

http://php.net/manual/en/reserved.variables.get.php

http://php.net/manual/en/reserved.variables.post.php

for example:

javascript:

    $(document).ready(function(){       var test = "test";       $('#someinput').value(test);    }); 

html:

<form action="some.php" method="post"> <input type="hidden" id="someinput" name="someinput"/> <input type="submit" value="send"/> </form> 

php:

<?php   var_dump($_post['someinput']); ?> 

Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -