ecojohnson
09-07-2001, 07:16 PM
I have the following form:
<FORM ACTION="action_page.cfm" METHOD="post" NAME="theform">
Input name: <INPUT TYPE="text" NAME="name" <cfif isdefined("name")>VALUE=<cfoutput>#name#</cfoutput></cfif>>
Input ID: <INPUT TYPE="text" NAME="ID" VALUE="">
<BR><BR>
<INPUT TYPE="button" NAME="Add_ID" VALUE="Add_ID" onClick="window.location='TestForm.cfm?name="+document.theform.name.value+"'">
<INPUT TYPE="button" NAME="Add_ID" VALUE="Clear" onClick="window.location='TestForm.cfm'">
<INPUT TYPE="submit" NAME="Submit_ID" VALUE="Submit">
</FORM>
I don't know if I am doing something wrong, but everytime I try to run this, I get a javascript error: "Unterminated string constant".
The problem lies somewhere in the code for the Add_ID button. If I remove the quotes around the + signs, it works, but then the string is added as the name field, which is not what I want.
Any ideas or tips?
<FORM ACTION="action_page.cfm" METHOD="post" NAME="theform">
Input name: <INPUT TYPE="text" NAME="name" <cfif isdefined("name")>VALUE=<cfoutput>#name#</cfoutput></cfif>>
Input ID: <INPUT TYPE="text" NAME="ID" VALUE="">
<BR><BR>
<INPUT TYPE="button" NAME="Add_ID" VALUE="Add_ID" onClick="window.location='TestForm.cfm?name="+document.theform.name.value+"'">
<INPUT TYPE="button" NAME="Add_ID" VALUE="Clear" onClick="window.location='TestForm.cfm'">
<INPUT TYPE="submit" NAME="Submit_ID" VALUE="Submit">
</FORM>
I don't know if I am doing something wrong, but everytime I try to run this, I get a javascript error: "Unterminated string constant".
The problem lies somewhere in the code for the Add_ID button. If I remove the quotes around the + signs, it works, but then the string is added as the name field, which is not what I want.
Any ideas or tips?


