NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: kevin plummer on May 27, 2010, 06:11:27 PM
-
Hi All,
Is there a way to pass what has been typed into a field to a session variable without tabbing off a field?
Here is my dilemma:
I have a vendor code field. I have implemented function keys to call the lookup window rather than a button. The problem is if I type PLU and then press F8 my server side code has not run and when I get to the lookup screen it is waiting at the top of the list. If I enter PLU tab and then shift tab back and press F8 then it works - not exactly user friendly.
Any suggestions?
Cheers,
Kevin
-
Hi Kevin,
there is a JavaScript function,
SetSessionValue('name','value');
which you can call from the browser. So you could trap all keydowns, (like you're doing for F8).
But that's not really the right answer is is. No, what you need to do is extend the URL you're using so
that the "current value" of the field is passed as a parameter in the URL.
so, something like (untested...)
'jQuery(document).bind(<39>keydown<39>, <39>F8<39>, function()<123>window.open(<39>ChartOfAccountsLookup?plu=<39> + FieldValue(this,1),<39>_self<39>)<125>);'
You may need to experiment with the FieldValue part - my guess is you may need to put in the actual field id etc...
Cheers
Bruce
-
Hi Bruce,
I tried + FieldValue(this,1) but this has broken the F8 function. I gather it doesn't run if the javascript is invalid.
I have tried a few combination's but my knowledge of Javascript and JQuery is pretty limited. I did a lot of google searches to try and find some more information but didn't find anything useful.
Any Javascript JQuery gurus out there that can help me?
Cheers,
Kevin