NetTalk Central

Author Topic: Disable/Enable Save button  (Read 3050 times)

markster

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
Disable/Enable Save button
« on: December 13, 2013, 05:55:15 PM »
I would like to open a data entry form with the Save button displayed but disabled. Then once specific conditions are met, based on user data entry, I would like to enable the Save button.  Is there a simple way to do this?

Regards,

Mark

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11242
    • View Profile
Re: Disable/Enable Save button
« Reply #1 on: December 16, 2013, 03:33:20 AM »
I don't think there's a really simple way to do this. I've made a note for a future build.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11242
    • View Profile
Re: Disable/Enable Save button
« Reply #2 on: January 20, 2014, 02:37:09 AM »
Hi Mark,

at the end of the FormGenerate routine;

p_web.jQuery('#' & clip(loc:formname) ,'ntform','"disableSave"')

then when the conditions are met (presumably in the server side code of one or more fields)

p_web.jQuery('#' & clip(loc:formname) ,'ntform','"enableSave"')

cheers
Bruce


kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Disable/Enable Save button
« Reply #3 on: January 20, 2014, 09:12:34 PM »
will this method work on older builds?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11242
    • View Profile
Re: Disable/Enable Save button
« Reply #4 on: January 20, 2014, 09:23:32 PM »
yes, these methods are used by the File Uploader so I think this goes back a fair ways.

cheers
Bruce

kingja

  • Sr. Member
  • ****
  • Posts: 261
    • View Profile
    • Email
Re: Disable/Enable Save button
« Reply #5 on: January 21, 2014, 10:56:24 AM »
Bruce and Kevin,

     I just tried this and I lose all tabs on the form in question.  Still experimenting.

Jeff
« Last Edit: January 21, 2014, 11:03:37 AM by kingja »

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11242
    • View Profile
Re: Disable/Enable Save button
« Reply #6 on: January 21, 2014, 10:30:02 PM »
check the FireBug console for a JavaScript error. If you had an error then you'd lose any further JavaScript - so things like the tabs and buttons would be "wrong".

cheers
Bruce