Copy link to clipboard
Copied
I am trying to remember where I saw the technique of adding a separate button to a coldfusion or flex page, other than the submit button, and calling a function to do something different like a query into database on insert page without inserting if onclick for update button is event.
Copy link to clipboard
Copied
Hi Gregory,
If I understand what it is you are trying to accomplish, perhaps something
like this:
<cfinput type="button" name="update_record">
below would send you to designated page and pass the record_id var to
the page, along with any additional forms
onClick="this.form.action='http://path/to/cf_page.cfm?record_id=#URLEncodedFormat(record_id)#';this.form.submit()" onMouseOver="style.cursor='pointer'"
- or -
<cfinput type="submit" name="btn_insert" ..>
<cfinput type="submit" name="btn_update" ...>
then on same page try the following:
<cfisdefined('form.btn_insert')>
- - - do whatever it is you want done
<cfisdefined('form.btn_update')>
- - - do whatever it is you want done
Leonard B
Copy link to clipboard
Copied
When I get back to that page, your second example seems like it might work out. I might also try
using Phillip Churvis's advanced custom tag technique from Advanced Macromedia ColdFusion MX7 Application Development, in which one page adds, deletes, updates, and views records from a database.
Copy link to clipboard
Copied
Hi Leonard,
When I get back to trying to get the form to work, it looks like your first example may also work if I check for cfif isdefined("url.recordid").
I probably could also use JavaScript and ColdFusion together through the use of some of Ben Forta's cascading selects type technique, as well.
Gregory