php - Passing a JavaScript variable to the view through a HTML form -


i'm having issue passing javascript variable through form correctly controller. i'm not sure how since it's first time working javascript. appreciated.

my code can found below:

  <script>     function finddoc(e){       ...       var id = grid._data[rindex].document_id;    }     ...     {title: grab, template: "<form action = '<?php echo $exepath;?> docs/grab' method = 'post'><input type = 'submit' value = 'id'></form>", width: 90}     </script> 

if attempting concatenate value of id javascript variable string in code have use javascript's string concatenation operator:

{title: grab, template: "<form action = '<?php echo $exepath;?> docs/grab' method = 'post'><input type = 'submit' value = '"+id+"'></form>", width: 90} 

also, don't think want space in action url between php echo , docs/grab


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -