I have a form where I need the text value to be passed to another form element later on.
Right now, it have
<form method='post' action='https://secure.autho...ay/transact.dll' >
<input type='text' name='amount' value='50.00' />
Change: <input type="checkbox" name="chg" onclick="myF(this.form)">
<script type="text/javascript">
function myF(val) {
var num = val;
var n = num.toString();
alert("You have now changed the amount to pay: " + n );
}
</script>
<input type='text' name='x_amount' value='<?php echo $_REQUEST['num'] ?>' />
<input type='Submit' value='Pay Now'>
</form>
It will then return the Alert box & in place of + n, it says object HtmlFormElement.
I tried doing a document.getElementById(this.form), but I think that gave me a null.
I know I will later need to do a validation to make sure it is a number & 2 decimals, but for now I need my alert & variable to be passed right.
I've tried + n, + val, had it to where it didn't create the toString...nothing works