Solved

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

Posted on 2004-04-19
9
194 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…
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…

816 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

11 Experts available now in Live!

Get 1:1 Help Now