i am using web3.js to communicate with my smart contract.
how ever, when i try to submit the html form, and then use contract.deployed(), it isnt working
below is the code.
Html
<div id ="input" style="display: none; margin-left:50% ">
<form id="stuff">
<label for="Survey Number">Survey Number</label>
<input id= "sno" type="text" placeholder="Enter survey Number" name="sno" required>
<br>
<label for="dis">Choose a Disease:</label>
<select id="disease" name="disease">
<option value="0">Fungal infection</option>
<option value="1">Allergy</option>
<option value="2">GERD</option>
<option value="3">Chronic cholestasis</option>
<option value="4">Drug Reaction</option>
</select>
<br>
<button id = "registerbtn" type="submit" class="registerbtn" >Register</button>
</form>
</div>
js code
render: function() {
$('#input').attr('style', 'margin-left:25%');
$('#getCount').attr('style', 'display: none;');
web3.eth.getCoinbase(function(err, account) {
if (err === null) {
App.account = account;
$("#accountAddress").html("Your Account: " + account);
}
});
$('#registerbtn').click(function(){
$('#stuff').submit(function(){
App.contracts.Geriatric.deployed().then( function(instance){
alert("insatnce "+instance);
});
});
});
},
The alert in the App.contracts.Geriatric.deployed() is not occurring,i cant seem to find what the real issue is.The App.contracts.Geriatric.deployed() works fine when not inside the submit event.