NetTalk Central

Author Topic: Server Side Code  (Read 3205 times)

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Server Side Code
« 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

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Server Side Code
« Reply #1 on: May 28, 2010, 04:08:13 AM »
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

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Server Side Code
« Reply #2 on: May 31, 2010, 06:44:52 PM »
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