<a href="javascript:submit_form(1)"><img src="process.gif"></a>
<a href="javascript:submit_form(2)"><img src="calculate.gif"></a>
<a href="javascript:submit_form(3)"><img src="compare.gif"></a>


and at the top of the page U must insert:

<script language="javascript">
function submit_form(flag){
  if (flag == 1) {
    vargo = "process.cfm"
  }
  else if (flag == 2) {
    vargo = "calculate.cfm"
  }
  else if (flag == 3) {
    vargo = "compare.cfm"
  }
  vargo = vargo + "&field1=" + document.form1.field1.value (etc....)
  window.location = vargo
}
</script>

i think it is ok....

byz
L.



-----Original Message-----
From: John McCosker [mailto:[EMAIL PROTECTED]]
Sent: mercoled� 22 agosto 2001 16.48
To: CF-Talk
Subject: submit buttons


Has anyone worked a way round this?

I have a form with multible submit buttons, each submit will perform a
different procedure when submitted.

I want to use the name attribute of each button to define my conditions in
the next template e.g.

<input type="submit" name="process" value="Process Order">
<input type="submit" name="calculate" value="Calculate">
<input type="submit" name="compare" value="Compare">

<cfif isdefined("process")>
        process..
<cfelse>
        <cfif isdefined("calculate")>
        calculate..
<cfelse>
        <cfif isdefined("compare")>
        compare..
</cfif>
</cfif>
</cfif>

The only problem is the design team insist on using graphics for the form
buttons
the name attribute does not work with

<input type="image" name="compare" src="../../images/compare.gif">

neither do they want to use a class attribute and style the button which
would work..

I know I could pretermine their decision making and send them to one of
three forms but its going to mean more work for me.
I like this way because its cleaner.

If anyone worked a way round this I would appreciate to hear from you.

Cheers

JMC
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to