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!

AddCommit/post does not work.

Status
Not open for further replies.

programmher

Programmer
May 25, 2000
235
US
I have a form (Update.cfm)that is supposed to post entered information from Update.cfm to Schedule.cfm.

I am using the following line of code in Update.cfm:

<form name=&quot;Update.cfm&quot; action=&quot;Schedule.cfm?cmd=addcommit&quot; method=&quot;post&quot;>

This is not working. Can anyone tell me why???

I would appreciate any informatio and insight!
 
provide more info ! what is not working ? do you have an error message ? what is your code ?
 
Iza,

My data entry form appears, I can successfully enter the data, I click the update button, and the previous form loads - but without my entered text. No error message. Below is the code:

(<center>
<input type=&quot;text&quot; name=&quot;InputDate&quot; value=&quot;{ts '2000-11-17 14:01:59'}&quot;>
<form action=&quot;Update.cfm?cmd=addcommit&quot; method=&quot;post&quot; name=&quot;Schedule.cfm&quot; id=&quot;eventsform.cfm&quot;>
<table border=&quot;0&quot; bgcolor=&quot;000000&quot; cellspacing=&quot;2&quot; cellpading=&quot;0&quot;><tr><td>
<table border=&quot;0&quot; width=&quot;100%&quot; bgcolor=&quot;black&quot; cellspacing=&quot;5&quot; cellspacing=&quot;0&quot;>
<tr>
<td width=&quot;100%&quot; align=&quot;center&quot;><font face=&quot;Arial&quot; size=&quot;+1&quot; color=&quot;000000&quot;>Add Event</font></td>

</tr>
<tr>
<td width=&quot;100%&quot;><font face=&quot;Arial,Verdana,Helvetica&quot; size=&quot;-1&quot; color=&quot;000000&quot;>Summary:</font><br>
<input type=&quot;text&quot; name=&quot;summary&quot; size=&quot;90&quot;>
</td>
</tr>

<tr>

<td width=&quot;100%&quot;>

<font face=&quot;Arial,Verdana,Helvetica&quot; size=&quot;-1&quot; color=&quot;000000&quot;>Description:</font><br>


<textarea name=&quot;description&quot; rows=&quot;10&quot; cols=&quot;80&quot;></textarea>

</td>
</tr>
<tr>
<td width=&quot;100%&quot; align=&quot;center&quot;>
<input type=&quot;hidden&quot; name=&quot;month&quot; value=&quot;11&quot;>
<input type=&quot;hidden&quot; name=&quot;year&quot; value=&quot;2000&quot;>
<input type=&quot;submit&quot; value=&quot;Add Event&quot;>&nbsp;
<input type=&quot;reset&quot; value=&quot;Reset&quot;>&nbsp;
<!--- <input type=&quot;button&quot; value=&quot;Cancel&quot; onClick=&quot;document.cancel.submit()&quot;> --->
</td>
</tr>
</table>
</td></tr></table>
</form>)
 
the page you want the data to be send to (and it's the page you want to be loaded after the submit button is pressed) is the one that is in the ACTION property
so what you write with &quot;<form action=&quot;update.cfm&quot; ... > is that you want &quot;update.cfm&quot; to be displayed after the form is submitted, and that's what you get !!!!
try <form action=&quot;schedule.cfm&quot; ..>

ah and btw, the name and id are values and don't specially need the .cfm
 
Iza,

Thanks for the input. I tried your suggestion but it did it did not work. I checked my original code and I do have the correct page referenced in the &quot;action&quot; statement. The problem lies with my entered comments - (like &quot;schedule 4 hours vacation&quot;) not updating to the original page - the original form re-opens - but without my comment &quot;schedule 4 hours vacation&quot;.

Have you any more thoughts?
 
Hi,

Well, it looks to me like the form is submitted properly and that is why you are getting no error messages. A SUBMIT button performs the ACTION, then clears the form for more input.

The reason you have no values for the fields when the form reappears is that there are no values to display. If you want this form to be both your SUBMITted form and a verifying display, you will need to save the values to hidden form fields.

Then display the values in the appropriate form fields, probably after checking if the hidden fields are empty. Use CFPARAM to set the original values of the hidden fields.

This is one of the more awkward devices in ColdFusion, since most programmers would use a duplicate form to allow the user to verify their input, using the same ACTION template. Personally, I find that device cumbersome, but it does make the code easier to understand on the first reading.

What are you doing with the values in the ACTION page, schedule.cfm? And how does it return control to you original page?

Paul

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top