Solved

input image type not passing name variable

Posted on 2002-04-16
5
150 Views
Last Modified: 2013-12-24
Here is my script: when hitting the submit button, it redirects to the new form, MainUpdate.cfm, but it does not recognize the parameter, AddUpdate: I get a cold fusion error saying: error resolving parameter AddUpdate


<html>
<head>
     <title>Main</title>
</head>
<body>
<form action="MainUpdate.cfm" method="POST" Name="Entry" > 
<!--- main.cfm --->
<table>
     <td>    
                    <input type="image"
                    name="AddUpdate"
                    value="Submit"
                    src="../images/Circle.gif">  
     </td>
</table>
</form>
</body>
</html>

<!--- MainUpdate.cfm --->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
     <title>Untitled</title>
</head>

<body>


<!--- MainUpdate.cfm --->
<cfif AddUpdate is "Search">
          <CFLOCATION URL="somewhereelse.cfm">
</cfif>
 
<cfif AddUpdate is "Submit">
     
          <!--- do some processing, and then return --->
          <cfoutput>
          inside MainUpdate.cfm, Addupdate = Submit
          </cfoutput>
          <cfabort>
          <CFLOCATION URL="main.cfm">
</cfif>



</body>
</html>


0
Comment
Question by:bayoff
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 19

Expert Comment

by:cheekycj
ID: 6946011
Unfortunately with input type image the value is not sent in HTML forms.

with input type image you get the xy coords of the user's click on that image.

You must either pass a hidden variable or do something else.

If you turn on DEBUG in CF, you will notice that what is being submitted is

AddUpdate.x=some_integer_value
AddUpdate.y=some_integer_value

CJ

0
 

Author Comment

by:bayoff
ID: 6946035
I've tried using hidden variables... But it didn't work if I had multiple occurences of the input type....

Here is an updated form....

Also, can you modify the forms so that they will work. Thanks.


<html>
<head>
     <title>Main</title>
</head>
<body>
<form action="MainUpdate.cfm" method="POST" Name="Entry1" > 
<!--- main.cfm --->
<table>
     <tr>
     <td>    
                    <input type="image"
                    name="AddUpdate"
                    value="Submit"
                    src="../images/Circle.gif">
                     
                    <input type="image"
                    name="AddUpdate"
                    value="Search"
                    src="../images/Circle.gif">
                   
                     
     </td>
     </tr>
</table>
Something here......  
<table>
     <tr>
     <td>    
                    <input type="image"
                    name="AddUpdate"
                    value="Submit"
                    src="../images/Circle.gif">
                     
                    <input type="image"
                    name="AddUpdate"
                    value="Search"
                    src="../images/Circle.gif">
                   
                     
     </td>
     </tr>
</table>

</form>
</body>
</html>





<html>
<head>
     <title>Untitled</title>
</head>

<body>


<!--- MainUpdate.cfm --->
<cfif AddUpdate is "Search">
          <!--- <CFLOCATION URL="somewhereelse.cfm"> --->
          <cfoutput>
          inside MainUpdate.cfm, Addupdate = Search
          </cfoutput>
</cfif>
 
<cfif AddUpdate is "Submit">
     
          <!--- do some processing, and then return --->
          <cfoutput>
          inside MainUpdate.cfm, Addupdate = Submit
          </cfoutput>
          <!--- <cfabort>
          <CFLOCATION URL="main.cfm"> --->
</cfif>



</body>
</html>
0
 
LVL 19

Accepted Solution

by:
cheekycj earned 20 total points
ID: 6946045
something like this should work:
<html>
<head>
    <title>Main</title>
</head>
<body>
<form action="MainUpdate.cfm" method="POST" Name="Entry1" > 
<!--- main.cfm --->
<table>
    <tr>
    <td>    
                   <input type="image"
                   name="AddUpdateSubmit"
                   value="Submit"
                   src="../images/Circle.gif">
                     
                   <input type="image"
                   name="AddUpdateSearch"
                   value="Search"
                   src="../images/Circle.gif">
                   
                     
    </td>
    </tr>
</table>
Something here......  
<table>
    <tr>
    <td>    
                   <input type="image"
                   name="AddUpdateSubmit"
                   value="Submit"
                   src="../images/Circle.gif">
                     
                   <input type="image"
                   name="AddUpdateSearch"
                   value="Search"
                   src="../images/Circle.gif">
                   
                     
    </td>
    </tr>
</table>

</form>
</body>
</html>





<html>
<head>
    <title>Untitled</title>
</head>
<body>
<!--- MainUpdate.cfm --->
<cfif IsDefined("FORM.AddUpdateSearch.x") AND IsDefined("FORM.AddUpdateSearch.y")>
         <!--- <CFLOCATION URL="somewhereelse.cfm"> --->
         <cfoutput>
         inside MainUpdate.cfm, Addupdate = Search
         </cfoutput>
<cfelseif  IsDefined("FORM.AddUpdateSubmit.x") AND IsDefined("FORM.AddUpdateSubmit.y")>
         <!--- do some processing, and then return --->
         <cfoutput>
         inside MainUpdate.cfm, Addupdate = Submit
         </cfoutput>
         <!--- <cfabort>
         <CFLOCATION URL="main.cfm"> --->
</cfif>
</body>
</html>
0
 

Author Comment

by:bayoff
ID: 6946057
Worked like a charm...


Thanks much!!!!
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 6946079
no prob.. Glad I could help and Thanx for the "A"
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question