I have these two codes that I want to combine into one, so when I click the genbtn it will add the response from the PHP file into the 'wallet' form like the function below adds the text 'bitcoin wallet after click' to it.
Instead of displaying it in an alert box like it does now, the variable in the PHP file that I want to display is $public if that helps.
I've been sitting fiddling with the code for 3 hours now with no luck.
You can check how it works now on for better understanding.
<script>
$(function () {
$('#genbtn').one('click', function () {
var text = $('#wallet');
text.val(text.val() + ' bitcoin wallet after click');
});
});
</script>
and:
<script>
$.ajax({
url: 'addygen.php',
success: function (response) {
alert(response);
}
});
</script>
html:
<input type="text" id="wallet" maxlength="34" pattern="^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$"
placeholder="Your Bitcoin wallet's address"></input>
#wallet. Post your HTML.addygen.phpis1KiJnydDYR9ZHfxNWrfGUtUKDJgVkTo4Qm(string like this)... That doesn't look like what you wish to be displayed.