delldimension
08-09-2003, 08:15 AM
Hello,
I have a text box in a Frontpage form. This form has several hidden fields also. This form is submitted to a CGI script. Thus the hidden fields appear, and the text also in the CGI page. However, I would like the hidden fields to use information from the Text Box. How would I put a variable into a hidden field. It is a small Java script program that modifies the string the user inputs.
Here it is: (I get no errors, not sure if its right though)
-----------------------------------------------
<SCRIPT language=Javascript>
<!--
function description() {
string = eval(document.order.name.value);
var shaftsize;
var i = 0;
while ( i < name.length() ) {
if ( ( name.charAt(2) + name.charAt(3) ) == 03 )
*****shaftsize = "Shaft Size: 1/2 inch"; ***(this right?)
}
document.submitform.custom2.value=shaftsize;
return custom2;
}
// -->
</SCRIPT>
----------------------------------------------------
The form part is as follows:
----------------------------------------------------
<FORM NAME=order METHOD=POST ACTION="http://www.------------.com/cgi/cart.pl">
<INPUT TYPE=HIDDEN NAME=price VALUE="121.00">
<INPUT TYPE=TEXT NAME=name VALUE="14XX - 01XX - XXXX" SIZE=25 MAXLENGTH=25>
*******<INPUT TYPE=HIDDEN NAME=custom2>******
<INPUT TYPE=SUBMIT NAME="add" VALUE="Add To Cart !">
</FORM>
-----------------------------------
The custom2 variable is a part of the 14XX-01XX-XXXX string. How do I put that into the form????
Thank you very much,
Patrick
I have a text box in a Frontpage form. This form has several hidden fields also. This form is submitted to a CGI script. Thus the hidden fields appear, and the text also in the CGI page. However, I would like the hidden fields to use information from the Text Box. How would I put a variable into a hidden field. It is a small Java script program that modifies the string the user inputs.
Here it is: (I get no errors, not sure if its right though)
-----------------------------------------------
<SCRIPT language=Javascript>
<!--
function description() {
string = eval(document.order.name.value);
var shaftsize;
var i = 0;
while ( i < name.length() ) {
if ( ( name.charAt(2) + name.charAt(3) ) == 03 )
*****shaftsize = "Shaft Size: 1/2 inch"; ***(this right?)
}
document.submitform.custom2.value=shaftsize;
return custom2;
}
// -->
</SCRIPT>
----------------------------------------------------
The form part is as follows:
----------------------------------------------------
<FORM NAME=order METHOD=POST ACTION="http://www.------------.com/cgi/cart.pl">
<INPUT TYPE=HIDDEN NAME=price VALUE="121.00">
<INPUT TYPE=TEXT NAME=name VALUE="14XX - 01XX - XXXX" SIZE=25 MAXLENGTH=25>
*******<INPUT TYPE=HIDDEN NAME=custom2>******
<INPUT TYPE=SUBMIT NAME="add" VALUE="Add To Cart !">
</FORM>
-----------------------------------
The custom2 variable is a part of the 14XX-01XX-XXXX string. How do I put that into the form????
Thank you very much,
Patrick