coldfusion里增删改查在同一页,怎么控制按钮
1.coldfusion里增删改查的按钮在同一页,怎么控制按钮 和各种的跳转
2.还有就是怎么在修改的记录的ID传到 下一个处理页面的?刚刚学不删很懂 懂的给点实例代码 谢谢!
[解决办法]
<cfif isdefined("deleteid") and isnumeric(deleteid)>
<cfquery datasource="db">
delete from table1 where id=#deleteid#
</cfquery>
<script lanugae="javascript">
alert("Delete OK");
document.location.href="yourpage.cfm";
</script>
<cfabort>
</cfif>
<cfif isdefined("addnew")>
<cfquery datasource="db">
insert into table1 (...) values(...)
</cfquery>
<script lanugae="javascript">
alert("Insert OK");
document.location.href="yourpage.cfm";
</script>
<cfabort>
</cfif>