• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Using multiple images as submit buttons

Participant ,
Feb 06, 2013 Feb 06, 2013

Copy link to clipboard

Copied

I have this form with 2 images as submit buttons

  • <INPUT TYPE="image" SRC="assets/images/lgstart_b.png" ALT="Submit Form" name="time_in">
  • <INPUT TYPE="image" SRC="assets/images/lgstop_bo.png"   ALT="Submit Form" name="time_out">

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>

Views

776

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 06, 2013 Feb 06, 2013

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")>

^_^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 06, 2013 Feb 06, 2013

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 07, 2013 Feb 07, 2013

Copy link to clipboard

Copied

Well the images didnt look that nice and I've switched to regular submit buttons styled with CSS 3.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 07, 2013 Feb 07, 2013

Copy link to clipboard

Copied

That won't solve the problem.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Feb 07, 2013 Feb 07, 2013

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation