HI,
I have a simple widget with two text boxes and a submit button.
------------------------------------------------------------------------------------
Enter name: [TextBox1]
Enter email: [TextBox2]
[Submit Button]
------------------------------------------------------------------------------------
The requirement is, on click of the button, we have to pass the values of both the textboxes to the extension method $MyExtension.MyMethod.
This method takes two params, inserts the value into the database and returns a boolean to indicate success or failure.
Widget code:
-------------------
<input type="text" id="NameText" />
<br />
<input type="text" id="EmailText" />
<br />
<input type="button" id="SaveButton" value="Save User" onclick=$MyExtension.MyMethod('john', 'john@example.com'); />
Issue:
--------
When I view the source of the page after it gets rendered, I see the following:
<input type="button" id="SaveButton" value="Save User" onclick=True />
So, as soon as the page is loaded, the extension method is invoked and substituted with the value (its return value).
Please let me know, if there is any way to invoke this method only onclick of the button.
Thanks in advance.