[ic] Adding products using a form

Stefan Hornburg racke at linuxia.de
Thu Jul 6 12:38:27 EDT 2006

Tim Good wrote:
>>-----Original Message-----
>>From: interchange-users-bounces at icdevgroup.org 
>>[mailto:interchange-users-bounces at icdevgroup.org] On Behalf 
>>Of Stefan Hornburg
>>Sent: Thursday, July 06, 2006 9:25 AM
>>To: interchange-users at icdevgroup.org
>>Subject: Re: [ic] Adding products using a form
>>Tim Good wrote:
>>>I am trying to us a form to add items to the products table.
>>>Interchange 5.4.1 Perl 5.8
>>>My form starts like:
>>><form action="[area @@MV_PAGE@@]" method="POST"
>>> [form-session-id]
>>><input type="hidden" name="mv_data_key" value="sku"> <input 
>>>type="hidden" name="ui_hide_key" value="1"> <input type="hidden" 
>>>name="mv_data_table" value="products"> <input type="hidden" 
>>>name="mv_data_function" value="insert"> <input type="hidden" 
>>>name="mv_action" value="set"> <input type="hidden" 
>>>name="mv_update_empty" value="1"> <input type="hidden" 
>>>name="mv_data_fields" value="sku prod_group description category 
>>>summary comment terms stamp location itemstart duration coa 
>>>samplebutton username price minimum buynow weight packaging 
>>>image image2 image3
>>>image4 image5 image6 thumb image_large file1 file2"> [seti 
>>>cancelurl]location.href=[page href="[cgi referring_page"][/seti] <p 
>>>align="center"><font color="red"> Below is a preview of 
>>your proposed 
>>>auction listing. By clicking on Submit you are agreeing to pay the 
>>>posting fee described in [page href="[area 
>>>Use <b>Submit</b> to actually submit if you are 
>>>        <input type="submit" name="operation" value="Submit"
>>>&nbsp;<input type="button" name="cancel" value="Cancel"
>>>onClick='[scratch cancelurl]' class="search_button"> </p> [loop 
>>>list="sku prod_group description category summary comment 
>>terms stamp 
>>>location itemstart duration coa samplebutton username price minimum 
>>>buynow weight packaging shipinfo image image2 image3 image4 image5 
>>>image6 thumb image_large file1 file2"] <input type="hidden" 
>>>name="[loop-code]" value="[value [loop-code]]"> [/loop]
>>>This is passed to the same page at:
>>>[elsif cgi operation eq 'Submit']
>>>[if cgi tmp_sku]
>>>[set ui_new_item]0[/set]
>>>[seti sku][counter file=etc/post_item.count start=60600001][/seti] 
>>>[/else] [/if] [perl]  $Values->{sku} = $Scratch->{sku}; [/perl]
>>>[update data]
>>>[include file="etc/post_item" interpolate=1]
>>>Your item has been submitted. Click [page href="[area [scratch 
>>>sku]]"]here to view your item.
>>>I am getting the error:
>>>ugauction /cgi-bin/ugauction/member/post_item.html probable 
>>bad form 
>>>-- number of values min=0 (image5) max=2
>>You have itemstart _two_ times in your form.
>>	Racke
> So if I follow this correctly this error message is a return from checking
> duplicate fields and (or)
> Checking for missing required fields?
> If above is correct, then would my error message also mean that (image5) is
> missing and required?

You can not have duplicate fields when submitting one item. I think you
can leave out fields, although that doesn't makes sense.


LinuXia Systems => http://www.linuxia.de/
Expert Interchange Consulting and System Administration
ICDEVGROUP => http://www.icdevgroup.org/
Interchange Development Team

More information about the interchange-users mailing list