[ic] Need serious help on interchange account.html page, info disappearing

Thanh Luong interchange-users@icdevgroup.org
Sat Dec 28 08:19:00 2002


--- Andrew Brown <Andrew@hergo.com> wrote:
> Hi all:
> 
> I've been looking at this code and have no clue where my problem is.
> Here is what is happening. Basically the account.html form gets
> validated after you click the continue button. Lets say for example
> you leave out a field, (address) its successfully shows the errors
> but does not save any of the fields that you inputed, if you leave
> out just one field everything else gets erased. The problem is all
> the information you successfully entered into the other fields
> disappears. When their is an error nothing in my form gets saved. I
> cannot for the life of me figure why when their is an error nothing
> gets saved. I don't know if its something in the account.html page or
> something in my profile.order file. I've attached the account.html
> code it's driving me bonkers. Its like nothing gets saved when their
> is an error.
> 
> 
> <!-- BEGIN CONTENT --><SCRIPT>    // JavaScript Form Validation Demo 
>   // by Paul Colton
>   function check_tax(form) {
>     // Make sure the email field is not blank
>     var foundState = false;
>     var ch = form.state.value;
>     ch = ch.toUpperCase();
>     [loop list="__TAXAREA__"]
>     if(ch == "[loop-code]") {
>       alert("You will be charged [currency][fly-tax
> [loop-code]][/currency] sales tax\nsince you are shipping to
> [loop-code]. Click Recalculate to see the amount in your total.");
>       foundState = true;
>     }
>     [/loop]
>     return foundState;
>   }
> </SCRIPT>
> 
> [userdb function=get_billing_names]
> [userdb function=get_shipping_names]
> 
> <table>
> <tr>
> <td><b>Please fill out your shipping and billing address.</b><br><br>
> When finished filling out the fields click the <br>Continue button
> to finish your order.</td>
> [comment]
> <td width="100"></td>
> <td>
>  <SCRIPT LANGUAGE="JavaScript">
> <!--
> function OpenShipping()
>  {
>   window.open('[area shippingfly]','anew',
>
config='height=500,width=550,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=yes');
> }
> // --></SCRIPT><b>Need help with Shipping?</b> &nbsp;<a
> href="javascript:OpenShipping()"><font color="#3333CC">Click
> Here</font></a></td>
> [/comment]
> </tr>
> </table>
> 
> 
> [set Save_database]
> [userdb save]
> [/set]
> <FORM ACTION="[process secure=1]" METHOD="POST" name="save">
> <INPUT TYPE=hidden NAME=mv_session_id VALUE="[data session id]">
> [if type=explicit compare="[error all=1 show_var=1 keep=1]"]
> <P>
> <b>There were errors in your last submission.</b>
> <br>
>  <blockquote>
>         <FONT color="__CONTRAST__">
>                 [error all=1 keep=1 show_error=1 show_label=1
> joiner="<br>"]
>         </font>
>         </blockquote>
> 
> They are shown in <FONT color="red">this color</FONT> below.</FONT>
> <P>
> [/if]
> [comment] account_change profile in etc/profiles.order [/comment]
> <INPUT TYPE=hidden NAME=mv_form_profile VALUE=account_change>
> <INPUT TYPE=hidden NAME=mv_todo     VALUE=return>
> <INPUT TYPE=hidden NAME=mv_nextpage VALUE=@@MV_PAGE@@>
> <INPUT TYPE=HIDDEN NAME=mv_check    VALUE="Save_database">
> 
> [set Save_database]
> [userdb save]
> [/set]
> 
> <table width="100%" border="0" cellspacing="0" cellpadding="0">
>   <tr>
>     <td><table width="100%" border="0" cellspacing="0"
> cellpadding="0" dwcopytype="CopyTableCell">
>   <tr> 
>           <td width="25%" bgcolor="#3366FF" height="31"> 
>             <div align="right"><font color="#FFFFFF"><b>Shipping
> Address</b></font></div>
>     </td>
>           <td width="30%" bgcolor="#3366FF" height="31">&nbsp;</td>
>     </tr>
>   <tr> 
>     <td width="25%" height="16">&nbsp;</td>
>     <td width="30%" height="16">&nbsp;</td>
>     </tr>
>   <tr> 
>     <td width="25%" height="16"> 
>       <div align="right"></div>
>     </td>
>     <td width="30%" height="16">&nbsp;</td>
>     </tr>
>   <tr> 
>     <td width="25%" height="21"> 
>       <div align="right">Company:</div>
>     </td>
>     <td width="30%" height="21"> 
>       <input type=text name=company value="[value company]" size="20"
> maxlength="40">
>     </td>
>     </tr>
>   <tr> 
>     <td width="25%" height="16"> 
>       <div align="right"><b>[error name=fname std_label="First Name:"
> required=1]</b></div>
>     </td>
>     <td width="30%" height="16"> 
>       <input type=text name=fname value="[value fname]" size="20"
> maxlength="20">
>     </td>
>     </tr>
>   <tr> 
>     <td width="25%" height="21"> 
>       <div align="right"><b> [error name=lname std_label="Last Name:"
> required=1]</b></div>
>     </td>
>     <td width="30%" height="21"> 
>       <input type=text name=lname value="[value lname]" size="20">
>     </td>
>     </tr>
>   <tr> 
>     <td width="25%" height="18"> 
>       <div align="right"><b>[error name=address1 std_label=Address:
> required=1]</b></div>
>     </td>
>     <td width="30%" height="18"> 
>       <input type=text name=address1 value="[value address1]"
> size="40" maxlength="40">
>     </td>
>     </tr>
>   <tr> 
>     <td width="25%" height="19"> 
>       <div align="right"></div>
>     </td>
>     <td width="30%" height="19"> 
>       <input type=text name=address2 value="[value address2]"
> size="40" maxlength="40">
>     </td>
>     </tr>
>   <tr> 
>     <td width="25%"> 
>       <div align="right"><b>[error name=city std_label="City:"
> required=1]</b> </div>
>     </td>
>     <td width="30%"> 
>       <input type=text name=city value="[value city]" size="20"
> maxlength="20">
>     </td>
>     </tr>
>   <tr> 
>     <td width="25%"> 
>       <div align="right"><b>[error name=state
> std_label="State/Province:" required=1]</b></div>
>     </td>
>     <td width="30%"> 
> 
>  [loop search="
>                 fi=state.txt
>                 sf=country
>                 se=[default country US]
>                 rf=state,name,country
>                 tf=sorder,name
>                 ml=100
>               "
>               option=state]
>               [on-match]<SELECT onChange="check_tax(this.form)"
> NAME=state>[/on-match]
>               [list]
>               [loop-change 1][condition][loop-param
> country][/condition]
>               <OPTGROUP LABEL="[data table=country col=name
> key='[loop-param country]']">
>               [/loop-change 1]
>               <OPTION VALUE="[loop-code]">[loop-pos 1]
>               [/list]
>               [on-match]</SELECT>[/on-match]
>               [no-match]<INPUT NAME=state VALUE="[value state]"
> SIZE=20>[/no-match]
>               [/loop]
> 
> 
> 
=== message truncated ===

http://www.icdevgroup.org/pipermail/interchange-users/2002-December/030283.html
I had this same problem on my form.

Good Luck,
Tom


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com