Print Page | Close Window

JavaScript "K" Event

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=2801
Printed Date: 29 Jan 26 at 8:09PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: JavaScript "K" Event
Posted By: JohnT
Subject: JavaScript "K" Event
Date Posted: 23 Dec 13 at 2:58PM
I'm trying to determine if my JavaScript is the problem or the "K" event for the FormFieldJavaScriptAction works differently than expected. My understanding is that the form field "K" event should fire after any keystrokes.

Given the code below, the event does not fire on the initial non-numeric keystroke. After that point it fires. Obviously, the intended behavior is to have this event fire right after ANY non-numeric key is pressed.

Thanks,
John 

DPL.AddGlobalJavaScript('JTJava2', 'function numcheck(){parseInt(event.value); if ((isNaN(event.value) || event.value <= 0) && event.value != "") {app.alert("Please enter only numbers",3,0,"Number Check"); event.value = "";}}');
...

DPL.FormFieldJavaScriptAction(QTYFld, 'K','numcheck()');



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk