JSFiddle - React, Tailwind, and code Playground

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/smoothness/jquery-ui.css">
<input type="text" id="txt1" name="textbox1">
<input type="button" id="btn"name="buttonExecute" value="Enter number">

<div id="dialog-form">
    <form>
        <label for="name">Name</label>
        <input type="text" name="name" id="txt2" class="text ui-widget-content ui-corner-all" />
    </form>
</div>

JavaScript

$(function() {
    $("#dialog-form").dialog({
        autoOpen: false,
        modal: true,
        buttons: {
            "Ok": function() {
                var text1 = $("#txt1");
                var text2 = $("#txt2");
                //Do your code here
                text1.val(text2.val().substr(1,9));
                $(this).dialog("close");
            },
            "Cancel": function() {
                $(this).dialog("close");
            }
        }
    });


    $('#btn').click(function() {
        $("#dialog-form").dialog("open");
    });

});