I have the following form fields to collect basic input from the user (a dollar amount).
<tr><td><span class="qText" name="settlement">1. Amount:</span></td></tr>
<td><input type="hidden" class="qAns" name="settlement_t1_a">
<input type="text" class="qAns" id="recovery_val" name="settlement_t1" oninput="formatValue('1');" required></td>
I'm trying to display a confirmation popup when the user clicks the submit button to say "verify amount is correct", and show the amount they entered in the above field "settlement_t1".
What am I doing incorrectly here?
<div class="submitDiv"><input type="submit" onclick="return confirm('Please confirm recovery amount is correct: $' + document.getElementsByName("settlement_t1")[0].value;" value="Submit Form"></div>
Everything works fine until I try to insert the element. As in, I can get it to prompt "Please confirm recovery amount is correct: $", but without the amount.