Solved

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

Posted on 2004-04-19
9
197 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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
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 …
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…

830 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