Copy link to clipboard
Copied
I have this form with 2 images as submit buttons
The problem is I can tget the next page to acknowldge either button. I am using CF9
Here is the form2.cfm page
<cfif IsDefined("FORM.time_in.X")>
TIME IN
<cfelseif IsDefined("FORM.time_out.X")>
TIME OUT
<cfelse >
Nothing
</cfif>
I get an 'undefined' message only
I know I have done this before what am I missing?
Here is the form with the 2 images as submit buttons
<form action="form2.cfm" method="post">
<table cellpadding="0" cellspacing="5">
<tr>
<td align="center" class="crewlist_time"><strong>Status</strong></td>
</tr>
<cfoutput query="get_employees">
<tr>
<td width="20" align="left"><input type="checkbox" checked name="Employee_ID" value="#Employee_ID#"/></td>
<td class="crewlist_cell"> #EMPLOYEE_NAME# </td>
<div class="clock">
<div class="clockin">Clock In</div>
<INPUT TYPE="image" SRC="assets/images/lgstart_b.png" ALT="Submit Form" name="time_in">
</div>
<div class="clockrt">
<div class="clockin">Clock Out</div>
<INPUT TYPE="image" SRC="assets/images/lgstop_bo.png" ALT="Submit Form" name="time_out">
</div>
</div></cfoutput>
<br>
<br>
</form>
Copy link to clipboard
Copied
I think FORM.time_in.X is only for IE. I don't think any other browser will see .X.
Try <cfif StructKeyExists(form,"time_in")>
^_^
Copy link to clipboard
Copied
I'm sure those two images look very nice but if someone submits the form with their keyboard, normal html behaviour by the way, things might not work as well as you had hoped.
Copy link to clipboard
Copied
Well the images didnt look that nice and I've switched to regular submit buttons styled with CSS 3.
Copy link to clipboard
Copied
That won't solve the problem.
Copy link to clipboard
Copied
I think the issue is that you neew a value parameter in the input tag, not just the name. But then I never use multiple submit buttons like this because of the issue Dan mentioned -- keyboard and "default" button if the user presses enter. If possible, I would recommend a plain button (as opposed to a submit) or an anchor tag.