Within a repeater item, I am dealing with two textboxes. The goal is to perform some processing on a value entered into one textbox and then display the result in the other textbox when the user leaves. Ideally, this needs to be handled client-side.
My JavaScript knowledge is limited, but so far I have managed to come up with:
<asp:TextBox ID="txtMarkup" runat="server" onblur='calculateValues(this,"txtPercentage")'></asp:TextBox>
<asp:TextBox ID="txtPercentage" runat="server" onblur='calculateValues(this,"txtMarkup")'></asp:TextBox>
//Some code
<script type="text/javascript">
function calculateValues(sender, target) {
//Perform calculations
var parent = sender.parentNode //get the container, so I can get the appropriate target
//This is where I'm having trouble
}
</script>
I am struggling to identify how to locate and update the other textbox with the processed value. Additionally, I am unsure if this approach is the most efficient, and I am willing to consider alternative solutions.
*EDIT
After exploring different methods, I finally achieved the desired functionality using a new technique. For those seeking a similar solution in the future, I have shared it as an answer below.