Alpha Video Training
Page 2 of 2 FirstFirst 12
Results 31 to 43 of 43

Thread: $25 for the Best Answer for Active Display of Dialog Field Validation Errors!!

  1. #31
    Member
    Real Name
    Steve Harris
    Join Date
    Oct 2012
    Location
    Houston
    Posts
    9

    Default Re: $25 for the Best Answer for Active Display of Dialog Field Validation Errors!!

    This thread wins my award for "most entertaining!!!"

    If life were as simple as offering a $25 reward, I'd post " ... how do i get my handicap down to 8?"

    note: and "get a pencil with an eraser" is not an acceptable answer!

  2. #32
    "Certified" Alphaholic forskare's Avatar
    Real Name
    Ken Nordin
    Join Date
    Apr 2000
    Location
    Walker, MN
    Posts
    7,545

    Default Re: $25 for the Best Answer for Active Display of Dialog Field Validation Errors!!

    Steve,

    Ahh, com'on now. You know the rules. Ya gotta offer $$ or you can't ask a question. Offer some $$ and you'll get any handicap you desire.
    TYVM :) kenn

    Knowing what you can achieve will not become reality until you imagine and explore.

  3. #33
    "Certified" Alphaholic peteconway's Avatar
    Real Name
    Peter Conway
    Join Date
    Oct 2005
    Location
    Melbourne, Australia
    Posts
    2,613

    Default Re: $25 for the Best Answer for Active Display of Dialog Field Validation Errors!!

    Member Status: 0 Friends says it all. - Great work - thanks Jim.
    Insanity: doing the same thing over and over again and expecting different results.
    Albert Einstein, (attributed)
    US (German-born) physicist (1879 - 1955)

  4. #34
    Member Roderick's Avatar
    Real Name
    Roderick Silva
    Join Date
    Aug 2006
    Location
    Miami, FL
    Posts
    141

    Default Re: $25 for the Best Answer for Active Display of Dialog Field Validation Errors!!

    I would pay $100 to anyone that comes up with a good answer and DOESN'T post it on this thread.

    I won't because that would be insulting to everyone that has ever attempted to help me in the past. I appreciate the community and guidance that this board has provided for many years.

    $25 is about 15 minutes worth of time from anyone knowlegeable enough to provide an answer. Don't sell yourself short.
    Thanks,

    Roderick Silva
    rodericksilva@gmail.com

    About Me: rodericksilva.com
    Twitter: rodericksilva

  5. #35
    "Certified" Alphaholic iRadiate's Avatar
    Real Name
    Stephen
    Join Date
    Jan 2011
    Location
    London, ON
    Posts
    1,641

    Default Re: $25 for the Best Answer for Active Display of Dialog Field Validation Errors!!

    Quote Originally Posted by Jim Coltz View Post
    I haven't seen a payment yet from Lawrence, but for those of you who do appreciate the code here's an update that uses a much nicer A5 window instead of those pesky javascript alerts. It comes from my calendar application and was created by using A5's examples. The main advantages over using a js alert are the alert's appearance is browser dependent and can be blocked. This code uses the style of the component for the pop up window and won't trigger the popup blocker. If you study the code you'll see you can add more buttons, add functions to those buttons, or turn them off. Add animation, toolbar buttons, etc.

    Code:
    if e.rtc.a_fieldValidationErrors.size() > 0
    	dim js as c
    	dim errorcontrol as c
    	errorcontrol = upper(e.rtc.a_fieldValidationErrors[1].varName)
    	js = <<%txt%
    					var pagename = "none";
    					var windowtitle = "Validation Error"
    					var windowid = '_valerror'; 
    					var btns = {};
    					btns['items'] = [
    					{
    						html: '',
    						name: 'x',
    						action: '',
    						disabled: false,
    						show: false},
    					{
    						html: '',
    						name: 'y',
    						action: '',
    						disabled: false,
    						show: false},
    					{
    						html: '',
    						name: 'z',
    						action: '',
    						disabled: false,
    						show: false},
    					{
    						html: 'OK',
    						name: 'zz',
    						action: function(){
    							this.hide();
    							
    						},
    						disabled: false,
    						show: true}
    					];
    					//btns['style'] = 'display:none;'; //uncomment to hide buttons.
    					btns['style'] = '';
    					var popupparms = {
    						type: 'modal-resizable',
    						width: '',
    						height: '',
    						bct: 'blank',
    						dbtns: btns,
    	%txt%
    
    	js = js + crlf() + "pmsg: "+"'<p style=\"margin: 10px;\"> " + e.rtc.a_fieldValidationErrors[1].errorText +"</p>'" + crlf()
    
    	js = js + <<%txt%
    						
    					};
    					jqcalPopUpWindow(pagename, windowtitle, windowid, popupparms);
    
    	function jqcalPopUpWindow(pagename, windowtitle, windowid, popupparms)
    	{
    		window.jqcal_popupwin = A5.PageWindows.createWindow(windowid, popupparms.type,
    		{
    			height: popupparms.height,
    			width: popupparms.width,
    			title: {
    				html: windowtitle,
    				tools: {
    					//items: false //uncomment if you don't want an X for closing the window in the title.
    				},			
    				location: 'top'
    			},
    			disableMove: false,
    			theme: '{grid.style}',
    			body: {
    				content: {
    					type: popupparms.bct,
    					url: '__workingMessage.a5w',
    					elementId: '~'
    				},
    				style: ''
    			},
    			onHide: function ()
    			{
    				return;
    		
    			},
    			//animation: {
    			//	show: {
    			//		type: 'fade',
    			//		duration: 'slow'
    			//	},
    			//	hide: {
    			//		type: 'fade',
    			//		duration: 'slow'
    			//	}
    			//},
    			buttons: popupparms.dbtns //need to add comma here if using options below.
    			/*optional top bar, bottom bar, header and footer. Uncommnet to use if desired.
    				tbar: {
    					show: false,
    					html: 'Top Bar',
    					style: ''
    				},
    				bbar: {
    					show: false,
    					html: 'Bottom Bar',
    					style: ''
    				},
    				header: {
    					show: false,
    					html: 'Header',
    					style: ''
    				},
    				footer: {
    					show: false,
    					html: 'Footer',
    					style: ''
    				}
    			*/
    		});
    		if (pagename != 'none')
    		{
    			$(jqcal_popupwin.getWindowId('body')).src = '__workingMessage.a5w';
    			jqcal_popupwin.show();
    			$(jqcal_popupwin.getWindowId('body')).src = pagename;
    		}
    		else
    		{
    			var currWindow = A5.PageWindows.getWindow(windowid);
    			var windowDiv = currWindow.getWindowId('body');
    			var arrHTML = [];
    			arrHTML.push('<p> </p>');
    			arrHTML.push('<p><strong>');
    			arrHTML.push(popupparms.pmsg);
    			arrHTML.push('</strong></p>');
    			arrHTML.push('<p></p>');
    			var windowHTML = arrHTML.join('\n');
    			$(windowDiv).innerHTML = windowHTML;
    			//$(windowDiv).innerHTML = popupparms.pmsg;
    			currWindow.show();
    		}
    	}
    	
    	%txt%
    
    	dialogValidate.hasError = .t.
    	dialogValidate.errorText = "Form has Validation Errors"
    	e.javascript = "{dialog.Object}.setFocus('"+errorcontrol+"');" + crlf() + js
    	
    end if

    I've been playing with this code all morning but I just can't make it work, but I really, really, want it to. The popup window never comes up although my dialog doesn't submit if there are validation errors.
    Since it's Jim's code, odds are definitely that it's something I'm doing wrong.

    Here's my setup, if anyone can offer any suggestions:

    Validation Properties.jpg

    Date Properties.jpg , Date Validation Rules.jpg

  6. #36
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,351

    Default Re: $25 for the Best Answer for Active Display of Dialog Field Validation Errors!!

    $25? And how much will this chap (ess) be getting for the job?
    I got a bit annoyed at the arrogant replies earlier. Decided that calling him/her a wnaker would bring me down to that level.
    Ho Hum, ban me.
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

  7. #37
    Member
    Real Name
    Jim Coltz
    Join Date
    Oct 2005
    Location
    Western Pennsylvania
    Posts
    600

    Default Re: $25 for the Best Answer for Active Display of Dialog Field Validation Errors!!

    I tested this with a simple test case and it worked. On looking over your settings I set up a dialog with a date field and used your settings for the validation. I then got an error.

    There are some characters in the error text that A5 generates that are wreaking havoc with the JavaScript.

    Replace the line:
    Code:
    js = js + crlf() + "pmsg: "+"'<p style=\"margin: 10px;\"> " +e.rtc.a_fieldValidationErrors[1].errorText +"</p>'" + crlf()
    with:
    Code:
    js = js + crlf() + "pmsg: "+"'<p style=\"margin: 10px;\"> " +js_escape(e.rtc.a_fieldValidationErrors[1].errorText) +"</p>'" + crlf()
    Jim Coltz
    Alpha Custom Database Solutions, LLC
    A5CustomSolutions.com
    jimcoltz@a5customsolutions.com

  8. #38
    "Certified" Alphaholic iRadiate's Avatar
    Real Name
    Stephen
    Join Date
    Jan 2011
    Location
    London, ON
    Posts
    1,641

    Default Re: $25 for the Best Answer for Active Display of Dialog Field Validation Errors!!

    Quote Originally Posted by Jim Coltz View Post
    I tested this with a simple test case and it worked. On looking over your settings I set up a dialog with a date field and used your settings for the validation. I then got an error.

    There are some characters in the error text that A5 generates that are wreaking havoc with the JavaScript.

    Replace the line:
    Code:
    js = js + crlf() + "pmsg: "+"'<p style=\"margin: 10px;\"> " +e.rtc.a_fieldValidationErrors[1].errorText +"</p>'" + crlf()
    with:
    Code:
    js = js + crlf() + "pmsg: "+"'<p style=\"margin: 10px;\"> " +js_escape(e.rtc.a_fieldValidationErrors[1].errorText) +"</p>'" + crlf()
    Jim, you never cease to amaze me my friend

    There it is .. working now! Thank you, this is awesome!

    Custom Validation.jpg

  9. #39
    Member
    Real Name
    Jim Coltz
    Join Date
    Oct 2005
    Location
    Western Pennsylvania
    Posts
    600

    Default Re: $25 for the Best Answer for Active Display of Dialog Field Validation Errors!!

    Thank you Stephen. For the purists that want things to be complete you can add a strtran() in there to preserve the line breaks that A5 is adding between the two messages.
    Code:
    js_escape(strtran(e.rtc.a_fieldValidationErrors[1].errorText,crlf(),"</br>"))
    9-18-2013 8-18-23 PM.png
    Jim Coltz
    Alpha Custom Database Solutions, LLC
    A5CustomSolutions.com
    jimcoltz@a5customsolutions.com

  10. #40
    "Certified" Alphaholic
    Real Name
    Scott
    Join Date
    Mar 2010
    Location
    Toronto,ON
    Posts
    1,031

    Default Re: $25 for the Best Answer for Active Display of Dialog Field Validation Errors!!

    Surprised anyone replied to this guy.
    Rotten attitude that shouldnt be rewarded
    Scott Moniz - Computer Programmer/Analyst
    REA Inc.
    http://reainc.net
    (416)-533-3777
    scott@reainc.net

    REA INC offers consulting services, programming services, systems design, database design, third party payment gateway integration (CHASE, PAYPAL, AUTHORIZE.NET) and developer support.
    If you need custom code, or 1-to-1 mentoring in any facet of your database/web application design,
    contact us to discuss options.

  11. #41
    "Certified" Alphaholic iRadiate's Avatar
    Real Name
    Stephen
    Join Date
    Jan 2011
    Location
    London, ON
    Posts
    1,641

    Default Re: $25 for the Best Answer for Active Display of Dialog Field Validation Errors!!

    Quote Originally Posted by aburningflame View Post
    Surprised anyone replied to this guy.
    Rotten attitude that shouldnt be rewarded
    Agreed Scott and what's the saying "an elephant never forgets!".

  12. #42
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,351

    Default Re: $25 for the Best Answer for Active Display of Dialog Field Validation Errors!!

    Not only me then?
    I came across a chap looking for work. His opening letter said "you may address me as Mr Davies. Do not use my first name as presumed familiarity will not be tolerated".
    Seems like his mum told him he was unique. Aren't we all?
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

  13. #43
    "Certified" Alphaholic kkfin's Avatar
    Real Name
    Kenneth
    Join Date
    Dec 2006
    Location
    EU
    Posts
    1,539

    Default Re: $25 for the Best Answer for Active Display of Dialog Field Validation Errors!!

    Quote Originally Posted by Ted Giles View Post
    His opening letter said "you may address me as Mr Davies. Do not use my first name as presumed familiarity will not be tolerated".
    At least somebody has sense of humor.

Similar Threads

  1. Display value of a field on a dialog that has been changed by an xBasic code
    By YigalAyalon in forum Application Server Version 11 - Web/Browser Applications
    Replies: 2
    Last Post: 09-07-2012, 12:04 PM
  2. Highlight Tabs Containing Field Validation Errors
    By floyd in forum Application Server Version 10 - Web/Browser Applications
    Replies: 0
    Last Post: 12-08-2010, 10:06 AM
  3. Formatting display of number field in a dialog
    By drgarytraub in forum Application Server Version 8
    Replies: 6
    Last Post: 04-28-2008, 08:39 PM
  4. Help with Grid Validation Template for Reporting Errors
    By rjonas in forum Web Application Server v7
    Replies: 0
    Last Post: 10-04-2006, 12:07 AM
  5. customize 'validation errors'
    By Sieward in forum Web Application Server v7
    Replies: 6
    Last Post: 02-18-2006, 08:46 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •