Link to home
Start Free TrialLog in
Avatar of bayoff
bayoff

asked on

input image type not passing name variable

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>


Avatar of cheekycj
cheekycj
Flag of United States of America image

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

Avatar of bayoff
bayoff

ASKER

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>
ASKER CERTIFIED SOLUTION
Avatar of cheekycj
cheekycj
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bayoff

ASKER

Worked like a charm...


Thanks much!!!!
no prob.. Glad I could help and Thanx for the "A"