Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

inputting checkbox values to database

Status
Not open for further replies.

8ginga8

Programmer
Dec 14, 2004
54
CA
here is the part of the form that is used:

<table>
<tr>
<td>Full-time, year round</td>
<td><cfinput type="text" name="q9_1" required="yes" message="Question 9. permits numbers only" size="4" /></td>
</tr>
<tr>
<td>Full-time, seasonal</td>
<td><cfinput type="text" name="q9_2" size="4" validate="integer" message="Question 9. permits numbers only" /></td>
</tr>
<tr>
<td>Part-time, year round</td>
<td><cfinput type="text" name="q9_3" size="4" validate="integer" message="Question 9. permits numbers only" /></td>
</tr>
<tr>
<td>Part-time, seasonal</td>
<td><cfinput type="text" name="q9_4" size="4" validate="integer" message="Question 9. permits numbers only" /></td>
</tr>

here is the action page.
<cfloop index="x" from="1" to="4">
<cfif IsDefined("FORM.q9_#x#") and "FORM.q9_#x#" NEQ "">
<cfquery datasource="#database#">
insert into q9_link (main_id, emp_id, precentage)
values ('#SESSION.horse.id#', #x#, FORM.q9_#x#)
</cfquery>
</cfif>
</cfloop>

i know that this is not right, can someone please help me, the problem is with the precentage part, I need the value that was submitted on the form to be inputted into the database and I know that using FORM.q9_#x# will not work, but i am stumped on what will
 
Code:
<cfloop index="x" from="1" to="4">
      <cfif IsDefined("FORM.q9_#x#") and evaluate("FORM.q9_"&x) NEQ "">
          <cfquery datasource="#database#">
     insert into q9_link (main_id, emp_id, precentage)
     values ('#SESSION.horse.id#', #x#, evaluate("FORM.q9_"&x))
     </cfquery>
      </cfif>
    </cfloop>

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
i tried that, and thanks for the quick response, but I still get an error

HTTP 500 - Internal server error
Internet Explorer
 
uncheck "show friendly error messages" in IE to see what the actual error is.

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
or check it... whatever it is.. make it the other.

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
Thanks alot, I had no idea about the error checking option in internet explorer, I have cursed that for the longest time, thank you, I got it working. It makes a big difference when you can see what is going on.
 
np, thank microsoft for trying to idiot proof IE. :/

We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top