NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: trent on August 13, 2015, 01:26:26 PM
-
Hi Bruce,
I'm trying to force the 'Save/Login' button to be clicked if the user only has access to one site but the button is not behaving as expected.
Attached is the test app. Login with username and password 'test' and click the 'Next' button. In debugview you should see 'clicking save button to force login'. In the firebug console you should see 'save clicked' which means the click event should have happened, but the form validation does not happen and the user is directed to the next tab with the 'Site' drop.
Regards,
Trent
[attachment deleted by admin]
-
Hi Trent,
your code is ok, but the Save button is disabled on the first tab, so the click is swallowed by the button. (clicking on disabled buttons does nothing by design.)
Fortunately there is a JavaScript method to enable the button (and a JavaScript method to do the save) so change
p_web.Script('$("button[name=''save_btn'']").click();')
to
p_web.ntForm(loc:formname,'enableSave')
p_web.ntForm(loc:formname,'clickSave')
Cheers
Bruce
-
Hi Bruce,
Good stuff! Is there also a method to disable the 'next' button or methods for hiding the 'next' and 'previous' buttons altogether?
Where can I find info on these methods and what else is there?
Regards,
Trent
-
Hi Trent,
>> Good stuff! Is there also a method to disable the 'next' button or methods for hiding the 'next' and 'previous' buttons altogether?
So the wizard interface is a JavaScript widget called ntwiz and the code for it is in jquery.nt-wiz.js.
there currently aren't methods in the widget to hide and unhide the next & prev buttons - but that could be added if necessary. However you can hide them there with;
p_web.script('$(''[name="wizprevious_btn"]'').hide();')
and
p_web.script('$(''[name="wiznext_btn"]'').hide();')
>> Where can I find info on these methods and what else is there?
the save button is part of the form, and you'll find the methods in jquery.nt-form.js
At the moment these JavaScript widgets are undocumented other than the code itself.
cheers
Bruce
-
Hi Bruce,
Thank you. One thing I have noticed:
1) Changing the properties of the 'Next' button does not work:
p_web.site.NextButton.TextValue = 'Log On'
p_web.site.NextButton.ToolTip = 'Click here to Log On'
p_web.site.NextButton.MobileText = 'Log On'
Haven't tested the 'previous' button.
Regards.
Trent
-
hi Trent,
NextButton and PreviousButton are for browses. You want WizNextButton and WizPreviousButton for the wizard.
Cheers
Bruce
-
Oops! Thank you.