Go Back   Serif Software Forums > Design and Publishing > WebPlus

Notices

WebPlus Questions about using WebPlus for website design

 
 
Thread Tools Display Modes
Old 29th June 2014, 12:17 PM   #21
Gaga
Advanced Member
 
Join Date: Feb 2013
Location: Ormskirk, Lancashire, UK
Posts: 569
Gaga is a glorious beacon of lightGaga is a glorious beacon of light
Default Re: Custom search button & form validation...

Quote:
Originally Posted by AlfredP View Post
From Kareem's previous posts about this, I would guess that he wants 'onblur' validation rather than 'onsubmit' validation: in other words, red error messages as you tab away from a form field which has not been completed correctly, instead of a series of error messages when you press the 'Submit' button.

Alfred
My own view, for what it's worth, is that validating a field when it loses focus is more annoying than anything else. You might for example be entering a postcode or a telephone number or a postal or email address and in the process of doing so forget exactly what it should be and so go on to fill in other fields in the meantime with the intention of coming back to the previous field later and modifying the entry. Having error messages pop up as soon as you leave the specific field is an annoyance rather than a help. Also, it is often the case that the validation of one specific field might itself depend on he contents of another not yet filled in field, and all sorts of other things. I just don't like onblur myself, other than perhaps in certain very specific circumstances. That's a personal opinion though, and others might differ.

Mike
Gaga is offline  
Old 29th June 2014, 08:41 PM   #22
Archibald
Master
 
Archibald's Avatar
 
Join Date: Feb 2009
Location: England
Posts: 14,386
Archibald has a reputation approching nirvanaArchibald has a reputation approching nirvanaArchibald has a reputation approching nirvanaArchibald has a reputation approching nirvanaArchibald has a reputation approching nirvanaArchibald has a reputation approching nirvana
Default Re: Custom search button & form validation...

Quote:
Originally Posted by iansyer View Post
Like the idea of the panel , what javascript would you use to activate the panel ?
The attached WPX7 file demonstrates how a panel and/or red outline can be displayed when validation fails.

To see it fully working you will need to set the form to a Serif Web Resources (SWR) email target. On submission, if fields are valid you will then see the SWR reCAPTCHA appear.

I have added custom validation script to each edit box. However it needs to be noted that:
Code:
valid=true;
needs to come before any other custom validation script when you view the code for the whole page. Also
Code:
return valid;
needs to be at the end of all custom validation script when you view the code for the whole page. Perhaps I should have put all the custom script together within the custom validation script for the whole form.

Within your added custom script you have to include the code to check validity of each edit box. This is not as simple as it may seem, especially validating an email address.

Quote:
Originally Posted by iansyer View Post
Could you also use a slider and panels within to display the relevant error meesages ?
I think it makes most sense to display individual panels beside each edit box. However consider my "Age" edit box. You may wish to display one of two messages if validation fails "Enter your age" or "You must be 16 or over". I think that could be done with a slider adjacent to the edit box.
Attached Files
File Type: wpp Validate panel 1.wpp (16.0 KB, 145 views)
__________________
Archibald

Last edited by Archibald; 30th June 2014 at 07:05 AM.
Archibald is offline  
Old 29th June 2014, 09:30 PM   #23
Gaga
Advanced Member
 
Join Date: Feb 2013
Location: Ormskirk, Lancashire, UK
Posts: 569
Gaga is a glorious beacon of lightGaga is a glorious beacon of light
Default Re: Custom search button & form validation...

Quote:
Originally Posted by iansyer View Post
Archibald,

Like the idea of the panel , what javascript would you use to activate the panel ?

Could you also use a slider and panels within to display the relevant error meesages ?
Actually, for what it's worth, the way I do it myself which I think is quite user friendly is to have a red coloured image and some text underneath (behind) each field and hide them so they cannot be seen. Then, when I do the "friendly" client side validation (as opposed to my more vigorous serverside spambot etc stuff) I just show the images and the text behind each rejected field as appropriate. Then, as the user fills in each of the fields which are shown as in error I remove the red box from the field he has just corrected, etc. Actually, I'm having a bit of difficulty describing it properly but you'll be able to see exactly what I mean if you go to my site and partially or incorrectly fill in the form on the rates and Enquiries page:

http://www.cookecottage.com.au/rates.html

Personally I think it is quite a user friendly way of doing it. (By the way, if you do submit an entry with all valid fields for test purposes then please enter something like "webmaster test only, please ignore this booking" in the remarks box otherwise my daughter will think it is a genuine booking).

Mike

Last edited by Gaga; 29th June 2014 at 11:18 PM.
Gaga is offline  
Old 29th June 2014, 10:18 PM   #24
Archibald
Master
 
Archibald's Avatar
 
Join Date: Feb 2009
Location: England
Posts: 14,386
Archibald has a reputation approching nirvanaArchibald has a reputation approching nirvanaArchibald has a reputation approching nirvanaArchibald has a reputation approching nirvanaArchibald has a reputation approching nirvanaArchibald has a reputation approching nirvana
Default Re: Custom search button & form validation...

Quote:
Originally Posted by Gaga View Post
Actually, for what it's worth, the way I do it myself which I think is quite user friendly is to have a red coloured image and some text underneath (behind) each field and hide them so they cannot be seen.
Attached is my demonstration, this time with a hidden panel underneath each edit box

If you used a hidden text frame instead of a panel you would not need any image.
Attached Files
File Type: wpp Validate panel 2.wpp (16.1 KB, 135 views)
__________________
Archibald
Archibald is offline  
Old 29th June 2014, 11:29 PM   #25
Gaga
Advanced Member
 
Join Date: Feb 2013
Location: Ormskirk, Lancashire, UK
Posts: 569
Gaga is a glorious beacon of lightGaga is a glorious beacon of light
Default Re: Custom search button & form validation...

Quote:
Originally Posted by Archibald View Post
. . . If you used a hidden text frame . . . you would not need any image.
Yes I know, but I created the cooke cottage site piecemeal whilst I was learning all this webpage stuff and it was basically used as a learning tool while I was trying to come to grips with WebPlus, HTML, JavaScript, CSS and Perl, all of which were completely new to me, all at the same time. That's why it is full of all sorts of quite rough stuff that I would do in a completely different way if I were starting it from scratch today.

Mike
Gaga is offline  
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
WebPlus X7: E-Commerce Form with Validation and Custom HTML folivio WebPlus 1 22nd November 2013 10:17 PM
WebPlus X6: Form - Radio Button - Validation Danna WebPlus 8 3rd September 2013 07:26 PM
WebPlus X6: Custom search box and button? Unique Reaper WebPlus 3 11th March 2013 11:16 AM
WebPlus X4: Custom Search Button works in IE but not FF Julie W WebPlus 2 10th June 2010 03:38 PM
Custom Search Button irfan WebPlus 14 23rd July 2009 10:51 AM


All times are GMT +1. The time now is 09:38 PM.