Because the widget is a part of the underlying page, passing data to and from it is simple. The dialog can be treated as any other standard element on the page. Let's look at a basic example.
We looked at an example earlier in the chapter which added some <button>
elements to the dialog. The callback functions in that example didn't do anything, but this example gives us the opportunity to use them. Add the following code above the <script>
tags in dialog14.html
.
<p>Please answer the opinion poll:</p> <div id="myDialog" title="Best Widget Library"> <p>Is jQuery UI the greatest JavaScript widget library?</p> <label for="yes">Yes!</label><input type="radio" id="yes" value="yes" name="question" checked="checked"><br> <label for="no">No!</label><input type="radio" id="no" value="no" name="question"> </div> <script type="text/javascript" src="development...