[ic] account.html conditional error checking

ICdev interchange.mail at virgin.net
Wed Oct 22 20:14:09 EDT 2003


I don't know if my last post about this was unclear (titled 'Checkboxes, 
userdb, account.html, checkout.html, etc.'), but it didn't get any replies, 
so I'll try again and keep it simpler this time.

In checkout.html and account.html, I am conditionally error checking the 
billing fields, depending on the value of a checkbox. This is working fine in 
the checkout page, but not account.html.

The problem is that even when the checkbox 'bill_eq_ship' variable is set, 
Interchange still tries to check for billing values.

Would someone please check the code below, and tell me what's up.


Bits from account.html:

- - -

[update values]

[comment]If never been set before, assign default[/comment]
[if !value bill_eq_ship]
  [if !value b_fname]
    [value name=bill_eq_ship set='yes' hide=1]
  [else]
    [value name=bill_eq_ship set='no' hide=1]
  [/else]
  [/if]
[/if]

[if value bill_eq_ship =~ /yes/i]
	[value name=b_fname set='']
	[value name=b_lname set='']
	[value name=b_company set='']
	[value name=b_address1 set='']
	[value name=b_address2 set='']
	[value name=b_city set='']
	[value name=b_state set='']
	[value name=b_zip set='']
	[value name=b_country set='']
[/if]

<FORM ACTION="[process secure=1]" METHOD="POST">
<INPUT TYPE=hidden NAME=mv_session_id VALUE="[data session id]">
<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]

<input type=checkbox name=bill_eq_ship value=yes [checked bill_eq_ship yes] 
onClick="this.form.submit()">

<INPUT TYPE=SUBMIT VALUE="Save Details">

[if items]
  [set Save and Checkout]
    mv_nextpage=ord/checkout
  [/set]
		
  <INPUT TYPE=SUBMIT VALUE="Save and Checkout" NAME=mv_click>
  <br><br>
  <A HREF="[area ord/checkout]">No change, go to checkout</A>
[/if]

</FORM>

[value name=bill_eq_ship set='no' hide=1]

- - -


Without [update values] in there, the checkbox value isn't remembered; how 
come account.html needs it, but not checkout.html?

Still have no idea what certain form variables like 'mv_click' are for.


In profiles.order:

__NAME__                            account_change
fname=required
lname=required
address1=required
city=required
country=required
[if value country =~ /^(US|CA)$/i]
	state=state_province
	zip=postcode
[else]
state=required
zip=required
[/else]
[/if]
&or phone_night=phone, phone_day=phone Must have day or evening phone number

email=required
&fatal = yes
email=email

[if value bill_eq_ship =~ /no/i]
b_fname=required
b_lname=required
b_address1=required
b_city=required
b_country=required
  [if value b_country =~ /^(US|CA)$/i]
	b_state=state_province
	b_zip=postcode
  [else]
	b_state=required
	b_zip=required
  [/else]
  [/if]
[/if]

&fail=@@MV_PAGE@@
&success=customerservice

__END__


Thank you.



More information about the interchange-users mailing list