Trying to call from log in page

Hi All, I am trying call a microflow from login.html page (custom) using before sign in the application.   function do_something()                 {                     var myinput = document.getElementById("myinput");  alert( 'Test:' + myinput.value);               {                                                                               callback:   function(){                                                         alert( 'Test:' + myinput.value);                                                                                                                 mx.processor.xasAction({                                                                         error:  function() {                                                                                     logger.error( + "error: error while executing search");                                                                                 },                                                                         actionname:     "Mymodule.myMF",                                                                         guids:          [object.getGUID()]                                                         });                                                     }                                      }); But I am getting following error-  Uncaught ReferenceError: mx is not defined     at do_something ((login):75) Can somebody please let me know what is correct way of calling functions from html.
2 answers

I think it depends on where you put the code. The error should be gone if it's triggered after mxui.js loaded. However, i don't think you can create something on server before you can login.


Hi Abhinay,

I am not sure what you are trying to achieve but adding javascript code to a mendix application should be done inside a custom widget. Inside the widget you can load the mx library using the define construct - you can find more details here 

Without a custom widget you have to find a way to load all mendix libraries and dependencies manually, but I would not recommend going down this route.


PS: Do you allow anonymous users in your App?