bharned
asked on
Adding additional record in a Web form, Dreamweaver (*.cfm)
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
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
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>
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>
ASKER
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Please post a comment, acept and answer, or close this question.
thank you
thank you
ASKER
Close Question
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.