Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a web form that needs to validate address field in Sweden. But in Sweden, a lot of addresses don't have addresses so I cannot use RequiredFieldValidator.

 

I am still required to make this active, to at least give the user an opportunity to type in an address IF they had one.

 

I then tried a CustomValidator but by design, the CustomValidator event will not fire if the field is left blank so there goes that idea...

 

I'm kinda stuck at this point. Anyone has any ideas? Changing the business logic is not going to happen.

 

To recap, form field needs to validate if left blank. However, we are accepting 'blank spaces' as a substitute if no address is available. Oh, and this needs to show up in the validationsummary which I'm using for the rest of the form fields that are legitimately using requiredfieldvalidator.

 

Thanks!

Posted
Blank space addresses are accepted as "We don't have an address" and is stored in database as such. We were just requested to show an option or reminder just in case the customer does have an address. Our previous asp forms on the web site used basic javascript to handle the entire form. However, we are trying to use .NET and all its built in controls to do all our future apps.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...