Image buttons not working

There are multiple image buttons on this page - most work, 2 do not.

Page 1 of 1

7 Replies - 2420 Views - Last Post: 19 August 2009 - 09:30 AM

#1 thequi1ter   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 14-August 09

Image buttons not working

Posted 14 August 2009 - 12:37 PM

<cfoutput><cfparam name="SPECIAL_DAY" default="#DateFormat(now(), "mm/dd/yyyy")#"></cfoutput>

<center>
<td width=30%><!--- This form allows the user to toggle back and forth between weeks. --->
  <cfform name="ChangeDate" method="POST" action="thisweek.cfm" onsubmit="doUpdate=0">
	<cfoutput>
		  <input type="hidden" name="OldTargetDate" value="#TargetDate#">
		<input type="hidden" name="hosp" value="#hosp#">
	</cfoutput>
	<input type =
	<input type="Image" src="graphics/viewLastWeek.jpg" name="submitLweek" value="submit" alt="Last Week">
		<!--- <input type="Submit" name="SubmitOption" value="View Last Week">     not working--->
		
		<input type="Image" src="graphics/viewNextWeek.jpg" name="submitNweek" value="submit" alt="Next Week"> 
		<!--- <input type="Submit" name="SubmitOption" value="View Next Week">not working--->
  </cfform>
</td>
<td width=30%>
  <cfform NAME="SPECIAL" method="POST" action="navigation\nav_week_chg2.cfm?#Dateformat(SPECIAL_DAY, "mm/dd/yyyy")#" onsubmit="doUpdate=0">
	<cfoutput>
	<!--- if this is a cfinput type field it doesn't allow users to insert even a valid date, if only an input field, allows users
		to write incorrect date. --->
		  <input type="hidden" name="OldTargetDate" value="#TargetDate#" validate="date" message="Please provide a valid date format mm/dd/yyyy.">
		<input type="hidden" name="hosp" value="#hosp#">
	</cfoutput>
	<!--- <cfinput type="text" name="SPECIAL_DAY" size="12" required="yes" validate="date" message="Enter Date as mm/dd/yy"> 
	 --->
	 Use calendar icon to select date.<br />
			<cfinput type="Text" maxlength="10" size="10" name="SPECIAL_DAY" required="yes" validate="date" message="Please provide a valid date format mm/dd/yyyy.">
			<a href="java script:show_calendar('SPECIAL.SPECIAL_DAY');">
			<img src="graphics/show-calendar.gif" width="24" height="22" border="0"></a>




		<!--- <input type="Submit" name="SpecialOption" value="Select Day"> --->
		 <input  type="Image" src="graphics/select.jpg" name="submitDate" value="submit" alt="Select Date"> <!--- --->
   <!--- <td> ---><!--- <span style="color:red;font-weight:bold">*</span>Select Date:<br /> --->
			<!--- </td> ---> 
	
	
	</cfform>



Mod Edit: Please use code tags when posting your code. Code tags are used like so => :code:

Thanks,
PsychoCoder :)

Is This A Good Question/Topic? 0
  • +

Replies To: Image buttons not working

#2 PsychoCoder   User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1663
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Image buttons not working

Posted 14 August 2009 - 12:39 PM

Are you receiving any errors? Does this code not work that way you intended it? When asking for help there are a couple items that are vital in order for someone to properly help you:
  • Post the code you're having problems with
  • Post the exact error you're receiving, if you are receiving one
  • If no error explain what the code is doing versus what you want it to do
  • Post your question in the body of your post, not the description field

EDIT: Moved to ColdFusion :)
Was This Post Helpful? 0
  • +
  • -

#3 kewlkreator   User is offline

  • D.I.C Lover
  • member icon

Reputation: 39
  • View blog
  • Posts: 1,068
  • Joined: 25-March 09

Re: Image buttons not working

Posted 14 August 2009 - 12:40 PM

Hello, could you please post your code like :code:? Also, this is HTML and should be moved there.

Edit: whoops! PsycoCoder beat me! :)

This post has been edited by kewlkreator: 14 August 2009 - 12:41 PM

Was This Post Helpful? 0
  • +
  • -

#4 PsychoCoder   User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1663
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Image buttons not working

Posted 14 August 2009 - 12:44 PM

You are right, moved to HTML & CSS :)
Was This Post Helpful? 0
  • +
  • -

#5 thequi1ter   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 14-August 09

Re: Image buttons not working

Posted 14 August 2009 - 01:00 PM

View PostPsychoCoder, on 14 Aug, 2009 - 11:39 AM, said:

Are you receiving any errors? Does this code not work that way you intended it? When asking for help there are a couple items that are vital in order for someone to properly help you:
  • Post the code you're having problems with
  • Post the exact error you're receiving, if you are receiving one
  • If no error explain what the code is doing versus what you want it to do
  • Post your question in the body of your post, not the description field
EDIT: Moved to ColdFusion :)


I do not get an eror.
The code doesn't do anything when clicking on the image buttons for ViewLastWeek and ViewNextWeek. If I use the grey default buttons the code switches to the last week or next week depending on which button was clicked. Sorry, but this is my first time... Thanks for moving my code to proper place.
Was This Post Helpful? 0
  • +
  • -

#6 expl0si0n34   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 17
  • Joined: 25-October 08

Re: Image buttons not working

Posted 14 August 2009 - 02:18 PM

</cfoutput>
	<input type =
	<input type="Image" src="graphics/viewLastWeek.jpg" name="submitLweek" value="submit" alt="Last Week">
		<!--- <input type="Submit" name="SubmitOption" value="View Last Week">	 not working--->
	   
		<input type="Image" src="graphics/viewNextWeek.jpg" name="submitNweek" value="submit" alt="Next Week">
		<!--- <input type="Submit" name="SubmitOption" value="View Next Week">not working--->
  </cfform>



Just glancing at your code, could it be because of the "<input type =" that you started to declare? Maybe delete that save and refresh the page.
Was This Post Helpful? 0
  • +
  • -

#7 thequi1ter   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 14-August 09

Re: Image buttons not working

Posted 15 August 2009 - 03:52 PM

View Postexpl0si0n34, on 14 Aug, 2009 - 01:18 PM, said:

</cfoutput>
	
	<input type="Image" src="graphics/viewLastWeek.jpg" name="submitLweek" value="submit" alt="Last Week">
		<!--- <input type="Submit" name="SubmitOption" value="View Last Week">	 not working--->
	   
		<input type="Image" src="graphics/viewNextWeek.jpg" name="submitNweek" value="submit" alt="Next Week">
		<!--- <input type="Submit" name="SubmitOption" value="View Next Week">not working--->
  </cfform>



Just glancing at your code, could it be because of the "<input type =" that you started to declare? Maybe delete that save and refresh the page.


thanks, I noticed that after I posted. However, even after cleaning that up, the Input type field when it includes the image doesn't work. I'm really stumped on this one. Whenever I return the input types to simple 'submit' (with the grey button) they work; when they're images the page appears to try to refresh but doesn't. I can't publish this web page with half the buttons as images and the other half as grey buttons.
Was This Post Helpful? 0
  • +
  • -

#8 mehul.saiya   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 19-August 09

Re: Image buttons not working

Posted 19 August 2009 - 09:30 AM

Send 2 Hidden fields when you use image for submit:
<input type="Hidden "name="SubmitOption1" value="View Last Week"/> and
<input type="Hidden "name="SubmitOption2" value="View Next Week"/>

Or try by removing spaces in value

Hope this should help:)

This post has been edited by mehul.saiya: 19 August 2009 - 09:33 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1