NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: markster on December 13, 2013, 05:55:15 PM

Title: Disable/Enable Save button
Post by: markster 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
Title: Re: Disable/Enable Save button
Post by: Bruce 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.
Title: Re: Disable/Enable Save button
Post by: Bruce 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

Title: Re: Disable/Enable Save button
Post by: kevin plummer on January 20, 2014, 09:12:34 PM
will this method work on older builds?
Title: Re: Disable/Enable Save button
Post by: Bruce 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
Title: Re: Disable/Enable Save button
Post by: kingja 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
Title: Re: Disable/Enable Save button
Post by: Bruce 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