Hi,
Using vs 2019. asp.net (vb)
I'm trying to do multiple things without posting the page like when a user starts typing in a textbox.
currently using
Protected Sub txtShip_TextChanged(sender As Object, e As EventArgs) Handles txtShip.TextChanged
btnAddShip.Enabled = True
End Sub
I understand I can use autopostback but I want it to be client side.
Thanks.
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
$('#txtShip').on('change', function () {
$('#btnAddShip').prop('disabled', false);
});
});
</script>
<table style="border-width:1px;border-style:solid;width:100%;">
<tr>
<th colspan="2">
<center>Profile</center>
</th>
</tr><tr>
<td style="width:50%;"><table style="border-width:1px;border-style:solid;width:100%;">
<tr>
<td rowspan="6" style="width:50%;"><select size="5" name="ctl00$MainContent$lstShips" id="MainContent_lstShips" style="width:100%;">
</select></td>
</tr><tr>
<td style="width:50%;"><input name="ctl00$MainContent$txtShip" type="text" value="New Ship Name" id="MainContent_txtShip" style="width:100%;" /></td>
</tr><tr>
<td><input type="submit" name="ctl00$MainContent$btnAddShip" value="Add new ship" id="MainContent_btnAddShip" disabled="disabled" class="aspNetDisabled" style="width:100%;" /></td>
</tr><tr>
<td><input type="submit" name="ctl00$MainContent$btnName" value="Change ship name" id="MainContent_btnName" disabled="disabled" class="aspNetDisabled" style="width:100%;" /></td>
</tr><tr>
<td><input type="submit" name="ctl00$MainContent$btnDefault" value="Make default ship" id="MainContent_btnDefault" disabled="disabled" class="aspNetDisabled" style="width:100%;" /></td>
</tr><tr>
<td><input type="submit" name="ctl00$MainContent$btnStart" value="START" id="MainContent_btnStart" disabled="disabled" class="aspNetDisabled" style="color:Green;font-weight:bold;width:100%;" /></td>
</tr>
</table></td><td style="width:50%;"><table style="border-width:1px;border-style:solid;width:100%;">
<tr>
<td><span>Name</span><input name="ctl00$MainContent$ctl04" type="text" readonly="readonly" /></td>
</tr><tr>
<td><span>Name</span><input name="ctl00$MainContent$ctl06" type="text" readonly="readonly" /></td>
</tr><tr>
<td><span>Name</span><input name="ctl00$MainContent$ctl08" type="text" readonly="readonly" /></td>
</tr>
</table></td>
</tr>
</table>