On Thu, 2002-03-14 at 05:33, Mark Stosberg wrote: > Jerry Hamlet wrote: > > > > I'm trying to use images to handle the submission of my forms (they look > > nicer) and I'm having trouble using them with the run_mode of > > CGI::Application. If my form needs to go in one direction, they work fine, > > but if the form can branch in multiple directions, I'm having trouble > > setting up a way to determine which way for the app to go. Using a hidden > > field wont work (within one form) as multiple 'rm' params would be sent. > > Jerry, > > How do you handle the case of a form going multiple directions when you > use a submit button instead of an image button? Is there something about > using an image that makes the situation different? Based an idea from > Jesse E, I usually use a bit of JavaScript to handle cases like this. > Here are some snippets: > > <!-- pre-declare the rm form field to avoid JavaScript errors --> > <input type="hidden" name="rm" value=""> > > <input type="image" name="image1" onClick="document.your_form_name.rm.value='path1'"> > <input type="image" name="image2" onClick="document.your_form_name.rm.value='path2'">
Can you not just use the following? <input type="image" name="rm" value="mode1" src="/images/mode1.gif"> <input type="image" name="rm" value="mode2" src="/images/mode2.gif"> I'm pretty sure that I've done that before with submit buttons, so it should work equally well with image buttons. Cees --------------------------------------------------------------------- Web Archive: http://www.mail-archive.com/[email protected]/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
