Solved

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

Posted on 2004-04-19
9
198 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Report: Liquid Web beats Amazon, Rackspace & More

A study by performance analyst firm Cloud Spectator finds that Liquid Web beats rivals Amazon, Rackspace and DigitalOcean when it comes to website and cloud application performance.

 
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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

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…
Turn A Profile Picture Into A Cartoon Using Photoshop And Illustrator This tutorial will teach you how to make a cartoon style image out of a regular picture. I have tried to keep the tutorial as simple as possible. I used Adobe CS4 for this tuto…
The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…

732 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