Click to See Complete Forum and Search --> : newbie - please help


bodine
03-02-2004, 10:18 AM
I am trying to get the date value produced by this script to be submitted in the form:

20040302 is the result of the script (it works for "write" but I can't pass the value to the form.

I know this is sloppy and out of order..thanks for your help..I have looked for the answer, but am very new to this. If this post belongs in a different forum, I apologize.




<DIV style="position:absolute; overflow:hidden; left:551px; top:355px; width:200px; height:125px; z-index:35"><FORM NAME="amount">
<INPUT TYPE="HIDDEN" NAME="startdate">
</FORM>

<SCRIPT LANGUAGE="JavaScript">
d = new Date()
Date.prototype.toString = function () {return [this.getFullYear(), this.getMonth()+1 < 10 ? '0' + (this.getMonth()+1) : this.getMonth()+1, this.getDate() < 10 ? '0' + this.getDate() : this.getDate()].join('')};
//document.write(d)
//var now = new Date();
document.amount.startdate.value = d;
</SCRIPT>

</DIV>

<form name="Amount" method="POST" action="https://www.linkpointcentral.com/lpc/servlet/lppay">
<input type="radio" name="chargetotal" value="50.00" style="position:absolute;left:394px;top:250px;z-index:10">
<input type="radio" name="chargetotal" value="100.00" style="position:absolute;left:394px;top:275px;z-index:11">
<input type="radio" name="chargetotal" value="250.00" style="position:absolute;left:394px;top:300px;z-index:13">
<input type="radio" name="chargetotal" value="500.00" style="position:absolute;left:394px;top:325px;z-index:14">
<input type="radio" name="chargetotal" value="1000.00" style="position:absolute;left:394px;top:350px;z-index:15">
<input type="radio" name="chargetotal" value="2500.00" style="position:absolute;left:394px;top:375px;z-index:16">
<input type="submit" value="Continue to Secure Payment Form" style="position:absolute;left:122px;top:400px;z-index:17">
<input type="reset" value="Clear Form" style="position:absolute;left:450px;top:400px;z-index:18">
<input type="hidden" name="mode" value="fullpay">
<input type="hidden" name="storename" value="88854">
<input type="radio" name="chargetotal" value="25.00" checked style="position:absolute;left:394px;top:225px;z-index:25">
<input type="radio" name="submode" checked style="position:absolute;left:122px;top:225px;z-index:26">
<input type="radio" name="submode" value="periodic" style="position:absolute;left:122px;top:275px;z-index:27">
<input type="hidden" name="periodicity" value="m1">
<input type="hidden" name="threshold" value="3">
<input type="hidden" name="txntype" value="sale">
<input type="hidden" name="installments" value="-1">
</form>

TheBearMay
03-02-2004, 11:23 AM
Biggest problem looks to be that you have two forms and that your hidden field is in one and everything else is in the other.

bodine
03-02-2004, 11:51 AM
thanks TheBearMay..that makes sense..I only want one form though..the one at bottom. I guess I don't know how to set up the variable or something. When I put the hidden input line regarding "startdate" in the real form, I get javascript error (null, etc.)

TheBearMay
03-02-2004, 12:02 PM
Try it this way then (I placed the script after the form, that way the form is instantiated prior to the script running):


<DIV style="position:absolute; overflow:hidden; left:551px; top:355px; width:200px; height:125px; z-index:35">

<form name="Amount" method="POST" action="https://www.linkpointcentral.com/lpc/servlet/lppay">
<INPUT type="text" NAME="startdate">
<input type="radio" name="chargetotal" value="50.00" style="position:absolute;left:394px;top:250px;z-index:10">
<input type="radio" name="chargetotal" value="100.00" style="position:absolute;left:394px;top:275px;z-index:11">
<input type="radio" name="chargetotal" value="250.00" style="position:absolute;left:394px;top:300px;z-index:13">
<input type="radio" name="chargetotal" value="500.00" style="position:absolute;left:394px;top:325px;z-index:14">
<input type="radio" name="chargetotal" value="1000.00" style="position:absolute;left:394px;top:350px;z-index:15">
<input type="radio" name="chargetotal" value="2500.00" style="position:absolute;left:394px;top:375px;z-index:16">
<input type="submit" value="Continue to Secure Payment Form" style="position:absolute;left:122px;top:400px;z-index:17">
<input type="reset" value="Clear Form" style="position:absolute;left:450px;top:400px;z-index:18">
<input type="hidden" name="mode" value="fullpay">
<input type="hidden" name="storename" value="88854">
<input type="radio" name="chargetotal" value="25.00" checked style="position:absolute;left:394px;top:225px;z-index:25">
<input type="radio" name="submode" checked style="position:absolute;left:122px;top:225px;z-index:26">
<input type="radio" name="submode" value="periodic" style="position:absolute;left:122px;top:275px;z-index:27">
<input type="hidden" name="periodicity" value="m1">
<input type="hidden" name="threshold" value="3">
<input type="hidden" name="txntype" value="sale">
<input type="hidden" name="installments" value="-1">
</form>
<SCRIPT LANGUAGE="JavaScript">
d = new Date()
Date.prototype.toString = function () {return [this.getFullYear(), this.getMonth()+1 < 10 ? '0' + (this.getMonth()+1) : this.getMonth()+1, this.getDate() < 10 ? '0' + this.getDate() : this.getDate()].join('')};
//document.write(d)
//var now = new Date();
document.Amount.startdate.value = d;
</SCRIPT>
</div>

bodine
03-02-2004, 01:15 PM
it worked..thanks a million

Two questions -

1) I had to capitalize "Amount" in the JS line ( is case sensitive?)

2) input type="text" vs "hidden" - makes a difference?

Thanks again!

TheBearMay
03-02-2004, 03:18 PM
Yes JS is case sensative. The "text" vs. "hidden" I changed just to make sure you were getting the value - you can change it back.

bodine
03-02-2004, 05:34 PM
thanks again..