Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspdotnet_website_programming thread: Extending User Reg to Non US


Message #1 by "Wayne Russell" <wrussell@k...> on Tue, 5 Nov 2002 12:41:16
I have looked at the New user regform can any body sugest the best way to 
extend this form to cater for Non-US zip. I have tried the following but 
the selected index does not fire until the value is sent back to the 
server.
private void StateDropDown_SelectedIndexChanged(object sender, 
System.EventArgs e)
{
string NonUs = "NU";
if (StateDropDown.Items[StateDropDown.SelectedIndex].Value == NonUs )
{	
	this.ZipCodeRegExp.Enabled=false;
}	
else
{
	this.ZipCodeRegExp.Enabled=true;
}
}
Message #2 by "Mike Gale" <info@d...> on Wed, 6 Nov 2002 08:24:03 +1300
Wayne Russell wrote:
> I have looked at the New user regform can any body suggest the best
> way to extend this form to cater for Non-US zip. I have tried the
> following but the selected index does not fire until the value is
> sent back to the server.

There are several issues here.
1)  The state list is unnecessary in some parts of the world
2)  The PostalCodes that you have identified
3)  The countries (which in my download is hardwired as "USA", though
this may have changed in later downloads)

You should also review the design.  i.e. Do really want to insist on
postal addresses and phone numbers?

That said here are some ideas:
A)  Make the state field "fill it in yourself optional".  You could
attempt to pop something in there depending on country, but that's a
huge job (unless you can find it already done, if so I'd love to hear).
B)  For PostalCodes change the validator to something that works
internationally.  (I currently use a "best guess" approach to a decent
Regular Expression, if you find a well researched RegEx I'd love to see
it.)  Remember British codes might look like "WA10 7DV" so create an
inclusive RegEx.
C)  For countries create a system rather like the existing one for
states but populated with countries.

Many web sites annoy their clients right up front.  Insisting on states,
where they do not exist, forcing US style postal codes, not enough room
for your address and dates formatted for a foreign land will drive some
customers away before they start!  As will requesting too much
information.  I recommend careful thought in your design. 

Mike Gale, Decision Engineering (NZ) Ltd.


Message #3 by Wayne Russell <wrussell@k...> on Wed, 6 Nov 2002 08:34:08 -0000
A) The problem that I have encountered is to make the DropDownlist of states
optional in the validator control. Want I wanted to do was use an event
method that would fire when the focus of the DropDownlist was lost. I would
then change the validator regular expression to match what was selected or
even disable it.

B) I have found it yet but there should be some a regular expression
repository which holds country postal codes and telephone numbers for the
world. If this was coded as a web service then all that would have to happen
is when selected the country (an addition DropDownlist as per your point C))
the web service would return with regular expressions for the postcodes and
telephone numbers.

Although this is becoming for more reaching for this application I still
would like to know how I could achieve A) above.

Regards

Wayne 
 



-----Original Message-----
From: Mike Gale [mailto:info@d...] 
Sent: Tuesday, November 05, 2002 7:24 PM
To: Website Programming with ASP.NET
Subject: [aspdotnet_website_programming] RE: Extending User Reg to Non US

Wayne Russell wrote:
> I have looked at the New user regform can any body suggest the best
> way to extend this form to cater for Non-US zip. I have tried the
> following but the selected index does not fire until the value is
> sent back to the server.

There are several issues here.
1)  The state list is unnecessary in some parts of the world
2)  The PostalCodes that you have identified
3)  The countries (which in my download is hardwired as "USA", though
this may have changed in later downloads)

You should also review the design.  i.e. Do really want to insist on
postal addresses and phone numbers?

That said here are some ideas:
A)  Make the state field "fill it in yourself optional".  You could
attempt to pop something in there depending on country, but that's a
huge job (unless you can find it already done, if so I'd love to hear).
B)  For PostalCodes change the validator to something that works
internationally.  (I currently use a "best guess" approach to a decent
Regular Expression, if you find a well researched RegEx I'd love to see
it.)  Remember British codes might look like "WA10 7DV" so create an
inclusive RegEx.
C)  For countries create a system rather like the existing one for
states but populated with countries.

Many web sites annoy their clients right up front.  Insisting on states,
where they do not exist, forcing US style postal codes, not enough room
for your address and dates formatted for a foreign land will drive some
customers away before they start!  As will requesting too much
information.  I recommend careful thought in your design. 

Mike Gale, Decision Engineering (NZ) Ltd.



Message #4 by "Mike Gale" <info@d...> on Thu, 7 Nov 2002 07:58:06 +1300
Wayne Russell wrote:
> A) The problem that I have encountered is to make the DropDownlist of
Delete the validator.
> 
> B) I have found it yet but there should be some a regular expression
An easier approach is to have a general purpose validation for all
countries.  (Get fancy on the server not on the browser.)

Mike Gale, Decision Engineering (NZ) Ltd.


Message #5 by Wayne Russell <wrussell@k...> on Wed, 6 Nov 2002 21:44:57 -0000
I don't understand your comments

Regards

Wayne

-----Original Message-----
From: Mike Gale [mailto:info@d...] 
Sent: Wednesday, November 06, 2002 6:58 PM
To: Website Programming with ASP.NET
Subject: [aspdotnet_website_programming] RE: Extending User Reg to Non US

Wayne Russell wrote:
> A) The problem that I have encountered is to make the DropDownlist of
Delete the validator.
> 
> B) I have found it yet but there should be some a regular expression
An easier approach is to have a general purpose validation for all
countries.  (Get fancy on the server not on the browser.)

Mike Gale, Decision Engineering (NZ) Ltd.




  Return to Index