[ic] Updating tables via form

jimtoro@hoflink.com jimtoro@hoflink.com
Fri, 4 May 2001 20:26:00 -0400 (EDT)


 I am using MV4.04a and I am trying to do a update of a database as per
 the "Updating Minivend database tables with a form" from the manual.

In the first page, I have the user enter the CODE for the item in question
with:

------------------------
<form method=post action="[process]">
<input type=hidden name="mv_doit" value="return">
<input type=hidden name="mv_nextpage" value="update_bookdata">
Booking Code Number <input type=text size=9 name="update_code" value="[value update_code]">
<input type=submit name="mv_submit" value="Edit Booked Date">
</form>
------------------------

Which seems to take the data fine, then it calls a page which includes the following
code:

----------------------------
[set mv_data_enable]1[/set]
[tag flag write]bookeddates[/tag]
<form method=post action="[process-target]">
<input type=hidden name="mv_data_table" value="bookeddates">
<input type=hidden name="mv_data_key" value="code">
<input type=hidden name="mv_data_function" value="update">
<input type=hidden name="mv_nextpage" value="updated">
<input type=hidden name="mv_data_fields"
      value="code,dbstartdate,dbbookdate,dbbookoccasion,dbbookrfirstname,dbbookrlastname,dbbookaddr1,dbbookaddr2,dbbookaddr3,dbbookrtown,dbbookrstate,dbbookrzipcode,dbbookcardonly,dbbookvendor,dbbookvenphone,dbbookitemno,dbbookitemdesc,dbbookmaxprice,dbbookuser,dbbookcardno,dbbookdesc,dbbookcardprice,dbbookcardwrite,dbbookcallme,dbbookgiftwrap,dbbcancelcode">
<pre>
[loop arg="[value update_code]"]
Booking ID Code:  [loop-code]
Booking Created on  <input type=text name="dbstartdate" size=20 value="[loop-field dbstartdate]">
Booked Date <input type=text name="dbbookdate" size=20 value="[loop-field dbbookdate]">
  ---(note- deleted all other fields just to save space in this message)---
[/loop]
</pre>
<input type=hidden name="mv_todo" value="set">
<input type=submit value="Update Booking">
</form>
------------------------------

 The problem is when the I use the above to edit a record it shows the
 CODE for the item and then all the other fields show the text to the left
 of the <INPUT> statements but empty values from the database in each box.
 If I look at the source of the page in the browser the values for each of
 the input lines comes up as 'value=""' instead of the fields data.  If I
 edit any field and hit submit it will then update the data in the
 database as normal. I verify this by going to minimate and using
 the database edit function to view the record. The new data shows up in
 the field for that record.

 How come I dont see the data for any of the fields when trying to update
 them via the above code but if I update a field it does the update in the
 database and keeps all other fields with their original information?.


------------------------------------------
 House Of Files Internet
 Web Consulting, Design and Hosting
 516-938-2421
 http://www.hofweb.com