Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

verify adding form data to DB

Status
Not open for further replies.

sliver

Programmer
Nov 16, 2000
23
US
I have a form that people might add information on a subject that someone else might have alreaddy entered. if someone else has alreaddy entered the subject I want the second person to have the options

A. Adding the subject again ("I have another set of info
that should have its own record")

B. Editing the present information ("I would like to edit
the previously entered information")

C. Nothing ("oops I didnt know that record was alreaddy in
there")

I have a form for entry and a form for editing that pulls up all old information from the database. there are other things going on in the page so I dont want to mess with the code too much but if there is maybee some sort of popup that can redirect to one of 3 pages still carrying all the form information if its needed I feel this would work. any other ideas??

Thank you in advance
Sliver
 
I'm not sure I understand what your real question is. Is there a specific problem you're having or something that you need to do but can't figure out? Your post seemed to state info about your app but you didn't seem to pose a specific problem or question. If you can be a more specific, I or someone else here can help.

GJ
 
Why not be proactive and add a drop down that lists available subjects.

<cfquery datasource=&quot;yourDSN&quot; name=&quot;getSubjects&quot;>
SELECT Subject
FROM SubjectsTable
ORDER BY Subject
</cfquery>

<cfselect name=&quot;subjects&quot; Size=&quot;1&quot;>
<cfoutput query=&quot;getSubjects&quot;>
<option>#subject#
</cfoutput>
</cfselect>

 
basicly I want a way to carry all the Form-Fields forward through a page.....

1. fill out form
2. page that says do you really want to do this
A. Yes
B. NO
3. use info from 1.

the client doesnt want me to use javascript so the easy method is not available.

thanx again in advance.

PS thanx for the drop down idea but the list would be like 200 items long.....
 
Hey Sliver,

On the page which prompts for confirmation, just store all of the previous page's variables in hidden input variables. You can then make two submit buttons with &quot;yes&quot;/&quot;no&quot; values and give the submit button a name as in &quot;<input type=&quot;submit&quot; name=&quot;choice&quot; value=&quot;yes&quot;>.

On page three, just check to see if &quot;action&quot; is yes and then do your insert/update if so. Otherwise, you know they chose not to confirm and you can re-direct elsewhere.

Here's a quick example.

Page 1
<form...
<input type=&quot;text&quot; name=&quot;subject&quot;><p>
<input type=&quot;text&quot; name=&quot;date&quot;><p>
<input type=&quot;submit&quot; value=&quot;Go&quot;>
</form>

Page 2
<form ...
<cfoutput>
<input type=&quot;HIDDEN&quot; name=&quot;subject&quot; value=&quot;#subject#&quot;><p>
<input type=&quot;hidden&quot; name=&quot;date&quot; value=&quot;#date#&quot;><p>
</cfoutput>
<input type=&quot;submit&quot; name=&quot;action&quot; value=&quot;Confirm Insert&quot;><p>
<input type=&quot;submit&quot; name=&quot;action&quot; value=&quot;Cancel&quot;>
</form>

Page 3
<cfif action is &quot;Cancel&quot;>
<cflocation ....
<cfelse>
...... DB insert code ...
</cfif>

Hope this helps,
GJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top