I am trying to explain this as clearly as possible. What I would like to to do in jQuery and my jQuery is not that good sadly, but I am trying to have user input several fields with information. Then on the same page use those inputs are far so I can call a jQuery function from an external page to start a bit of code.
Below is my code. Everything works except for the part where the user is inputting his information that has to be send along as data in ajax with do all sorts of others things later on in a PHP function that I have written.
My code is so far:
<input name="myField" id="myField" type="text"><br/>
<div id="output"></div>
<script type="text/javascript">
$('#myField').keypress(function() {
var txtVal = this.value;
$("#output").text(txtVal);
console.log(txtVal);
});
var value= '<?php echo $connect_d["value"] ?>';
var value= '<?php echo $connect_d["value"] ?>';
var value= '<?php echo $connect_d["value"] ?>';
var value = 'txtVal';
$(document).load(function(){
value();
});
</script>
<div class=""><p>To install <?php echo"$value"; ?> please click the button below to start the process. </p></div>
<input type="button" class="btn btn-outline btn-success btn-lg btn-block blinstbtn" onclick="<?php echo"$value"; ?>();" value="Start <?php echo"$value"; ?> install process" />
I hope this makes sense, but in short, i need people to fill in some fields and sent that over to an js function that i call in from an external file so I can have that function start a php function.
I only need help with how to make var out of the input fields so the function I have written in jQuery and ajax and use it right away when I click the button to start the install process.
Thanks for the help.