Hi,

I have a requirement where I have two form submit buttons in my page.
Please refer to "Generate Password" and "Add User" buttons in  the
wireframe [1].

<input class="btn btn-primary add-margin-bottom-3x" type="submit"
name="generatePassword"
       id="generatePassword" value="Generate Password"/>

<input class="btn btn-primary add-margin-bottom-3x" type="submit"
name="addUser" value="Add User"/>



-When click the "Generate Password" button, a call to onPost() method will
happen.
 Inside that we need to do necessary backend callings to generate the
password.

-Once the password is generated, and all other text boxes are filled, we
need to click the "Add User" button.
This will also call the same onPost() method.
This time the logic inside onPost will need to do a different set of logic
and calls.

*So, the same onPost() method will get called twice.*

1.What is the way to identify these two buttons seprately in the backend js
onPost() method?

2. As an alternative approach, can we use a fragment to hold the  "Generate
Password" button and its text box.
   Then we can handle button submits related to that button inside the
backend js of that fragment.


Do we have any other alternative approach to handle this kind of scenarios?



[1]https://raw.githubusercontent.com/wso2-dev-ux/product-is/master/
Wireframes/admin-portal/v2/3.1%20Add%20users%20-%20manually.png

Thanks,
-- 
Denuwanthi De Silva
Senior Software Engineer;
WSO2 Inc.; http://wso2.com,
Email: denuwan...@wso2.com
Blog: https://denuwanthi.wordpress.com/
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to