View Single Post
  #9  
Old 08-18-2008, 07:22 AM
  Victor D's Avatar 
Victor D Victor D is offline
 

X-Adept
  
Join Date: Aug 2008
Posts: 643
 

Default Re: Validation script to check if custom text field has been filled

Quote:
Originally Posted by Warwick
So what should I use?
Code:
if (value == false ) {

or
Code:
if (value == '' ) {

It seems to me two variants are possible.

Quote:
Originally Posted by Warwick
So what should I use?
And is there a way to let the script check if it is an url?
btw when using the 'Buy now' button the script is bypassed

It is highly depend on what are you mean by "correct URL".

Code:
var value = product_option_value("url"); if (value == false ) { alert("Sorry, you should enter an url"); return false; }
Should work. Code posted above by Ene is OK too. See if your custom field's name is exactly matching 'url' (including case)
__________________
Regards,
Victor Dubiniuk

X-Cart Skins Store
- twenty two different skins for 4.1.x and 4.2.x;
- 4.3.x compatible versions are available;
- refresh you store now!

Smart menu X-Cart add-on for 4.1.8 - 4.3.x
Featured Products Slide Show X-Cart add-on for 4.1.8 - 4.3.x
Reply With Quote