473,473 Members | 1,480 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Improving output from submission page

219 New Member
I'm just seeing if there's a better way I can do this. I want to display the results from my submission page which handles adds, edits, deletes. I want to display the Name, Description, and Date Entered information on the submission page, but to display the info I need to make sure I'm using the right query name.

This is what I have currently:

Expand|Select|Wrap|Line Numbers
  1. <cfif URL.op IS "Edit">
  2.     <cfoutput>Record #URL.sysID# Modified</cfoutput>
  3. <cfelseif isDefined("Form.Add")>
  4.     <cfoutput>Record #URL.sysID# Added</cfoutput>
  5. </cfif>
  6. <table class="enterEdit">
  7. <cfif URL.op IS "Edit">
  8. <cfoutput query="editSystem">
  9. <tr><td align="right"><b>Name: <b></td><td>#name#</td></tr>
  10. <tr><td align="right"><b>Description: </b></td><td>#description#</td></tr>
  11. <tr><td align="right"><b>Date Entered: </b></td><td>#DateTime#</td></tr>
  12. </cfoutput>
  13. </cfif>
  14. <cfelseif isDefined("Form.Add")>
  15. <cfoutput query="insertSystem">
  16. <tr><td align="right"><b>Name: <b></td><td>#name#</td></tr>
  17. <tr><td align="right"><b>Description: </b></td><td>#description#</td></tr>
  18. <tr><td align="right"><b>Date Entered: </b></td><td>#DateTime#</td></tr>
  19. </cfoutput>
  20. </cfif>
  21. </table>
  22.  
I'd rather have something like this:

Expand|Select|Wrap|Line Numbers
  1. <cfif URL.op IS "Edit">
  2.     <cfoutput query="editSystem">Record #URL.sysID# Modified
  3. <cfelseif isDefined("Form.Add")>
  4.     <cfoutput query="insertSystem">Record #URL.sysID# Added
  5. </cfif>
  6. <table class="enterEdit">
  7. <tr><td align="right"><b>Name: <b></td><td>#name#</td></tr>
  8. <tr><td align="right"><b>Description: </b></td><td>#description#</td></tr>
  9. <tr><td align="right"><b>Date Entered: </b></td><td>#DateTime#</td></tr>
  10. </table>
  11. </cfoutput>
  12.  
I tried doing this but I get an error stating that there's a </cfoutput> tag with no matching <cfoutput> tag. The way I have it works, but I'm just seeing if there's a better way to do this so I don't have to re-enter the same data twice. It's a little redundant.
Oct 1 '07 #1
2 2003
acoder
16,027 Recognized Expert Moderator MVP
Since you're using the same field names, give the query the same name so there's no need for an if-else branch.
Oct 1 '07 #2
dmorand
219 New Member
Since you're using the same field names, give the query the same name so there's no need for an if-else branch.
Ok, I'll give that a shot. thanks!!
Oct 1 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Beowulf | last post by:
Hi Guru's, I have a query regarding using PHP to maintain a user profiles list. I want to be able to have a form where users can fill in their profile info (Name, hobbies etc) and attach an...
3
by: Andy Tran | last post by:
I built a system using mysql innodb to archive SMS messages but the innodb databases are not keeping up with the number of SMS messages coming in. I'm looking for performance of 200 msgs/sec where...
2
by: Mark Rae | last post by:
Hi, I'm opening an ASP.NET page using the JavaScript window.showModalDialog method. This page has a submission button on it which, when clicked, opens a new window, which is pretty much as...
1
by: Larry Neylon | last post by:
Hi, I'm working on a VBScript application on IIS6 and I'm looking for some advice about the best way of replacing or improving session variable usage. The application is in a secure extranet...
7
by: degmsb | last post by:
With Java script when a user hits submit on a form on my site, is it possible to take the values from the form and submit them to another form on another Url without the user who submitted the form...
12
by: googlegroups | last post by:
Hi, I'm making a javascript program for rolling dice for a roleplaying game that's played in a forum. The die roll gets generated, gets stored as text in a hidden form field, and then gets written...
6
by: Oleg Konovalov | last post by:
Hi, I have a Java/JavaScript GUI application where I perform a lot of long DB operations , which takes 5-60 secs to perform. Sometimes user double-clicks the button or just gets impatient and...
6
by: cfish | last post by:
I'm trying to script my contact page and I have everything the way I want it however I cannot get my script to output Address, City, State, Zip & Phone Number when I get a email. It will output...
0
Thekid
by: Thekid | last post by:
I'm trying to auto send a form submission to a website but it isn't working. I've done this before and it worked but for some reason, using the same basic code, it doesn't seem to submit it. I'm...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.