?
Solved

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

Posted on 2004-04-19
9
Medium Priority
?
212 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
7 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
Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

 
LVL 35

Accepted Solution

by:
mrichmon earned 1000 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 1000 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

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

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

When deciding to adopt any help desk solutions many factors should be explored before taking decisions. This will change from business to another but in general there are some kind of rule of thumb. Here are some quick tips: Do we need only ticket…
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…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
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…
Suggested Courses
Course of the Month15 days, 22 hours left to enroll

850 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