Solved

Adding additional record in a Web form, Dreamweaver (*.cfm)

Posted on 2004-04-19
9
192 Views
Last Modified: 2013-12-16
I’m using Macromedia Dreamweaver MX 2004, and ColdFusion 6.1 to create a Web Forms application.  
If a User needs to ADD another record, I have created a “Repeating Region” in a table.  I need the Repeating region to only appear as needed (by a link or button).  The EditRegion1 will be an auto sequencing alpha numeric number (starting with (d)).  The EditRegion2 will contain a textbox and a radio button set.  
Is this a correct procedure?
How do I create the link or button to add another record with the “Repeating Region”?
Regards, Bill
0
Comment
Question by:bharned
  • 3
  • 2
  • 2
9 Comments
 
LVL 10

Expert Comment

by:rockmansattic
ID: 10859782
I have not workd with coldfusion much, It seems that to do what you are asking, you will have to have some dhtml or javascript to allow this process on the same page.  

I would think it is easir to create a new page that is dedicated to adding a new record.  with this, you do not need a repeat region.  To use a repeat region, you are listing certain records, not adding them.

If you are trying to add multiple records at the same time, then you will have to use some scripting to perform the add record function over and over until it is complete.

This is , of course, If i understand the question.
0
 
LVL 35

Expert Comment

by:mrichmon
ID: 10864144
Okay first of all you should not need a repeating region to add a record - only to display results from the database.

Second, I am a little confised as to what you are trying to do.

In general cold fusion applications work like this :

Page 1 - show current records, link to add new record.  COde would be something like this :

<cfquery datasource="mydsn" name="GetRecords">
SELECT * FROM mytable
</cfquery>

<html>
<body>

<cfoutput query="GetRecords">
<p>#Column1# #Column2#, etc...</p>
</cfoutput>

<a href="Page2.cfm">Add New Record</a>

</body>
</html>

Page2.cfm

<cfif IsDefined("Form.AddRecord")>
<cfquery datasource="mydsn">
INSERT INTO mytable (column1, column2, etc) VALUES (#Form.field1#, #Form.field2#, etc)
</cfquery>
</cfif>

<html>
<body>
<form name="AddForm" method="post" action="Page2.cfm">
<input type="text" name="field1">
<input type="text" name="field2">
etc...
<input type="submit" name="AddRecord" value="Add A New Record">
</form>
</body>
</html>

0
 

Author Comment

by:bharned
ID: 10867643
Sorry for the poor information to begin with. First of all, a BLANK online Web form is presented to a user Designed with Dreamweaver MX Studio.  There are no current records Yet.  The form has not been submitted to the database.

If a User needs to ADD another or different response to the same question (perhaps 20 times),  I have created a “Repeating Region” in a Dreamweaver layout table (not a database table).  I need the Repeating region to only appear again as needed (by a link or button).  The EditRegion1 will be an auto sequencing alpha numeric number (starting with (d)).  The EditRegion2 will contain a textbox and a radio button set.  
In other words I need to offer the user the ability to duplicate or repeat on screen, the same question he/she just answered but with a different number. Instead of just listing the same question 20 times.

Regards, Bill


0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 35

Accepted Solution

by:
mrichmon earned 250 total points
ID: 10870215
You can do that, but not by using dreamweaver to do your coding.  Because what you are asking for is to have a dynamic number of inputs where the use can submit as many  responses as needed.  This needs to be hand coded and while not Hard is more complex than what DW can do for you with basic repeat regions.
0
 
LVL 10

Assisted Solution

by:rockmansattic
rockmansattic earned 250 total points
ID: 10996332
In addition to mrichmons comment, that is not what repeat region is designed for.

It is designed to output information (records) form the database to the user, not as a duplicatior of anything else.

You could in this case use some sort of php or javascript .  If you presss this button, then echo <tr><td><input type=text name=variable value=<?php echo $var ++;?> ></td></tr>

then in the insert code, you would of course have to accomodate for these additional form elements.

Rockman
0
 
LVL 10

Expert Comment

by:rockmansattic
ID: 11160819
Please post a comment, acept and answer, or close this question.

thank you
0
 

Author Comment

by:bharned
ID: 11500374
Close Question
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now