Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I want to add a text box at the end of the dialog box, so I have achieved this like this
HTML
$(".LASERAction").dialog({
autoOpen: false,
height: 450,
width: 600,
modal: true,
buttons: {
Ok: function () {
//My Submit code
}
}
});

var textBoxHTML = '
<input type="text" class="form-control InteractionText" id="InteractionFinalText" />
'
$(".ui-dialog-buttonpane").prepend(textBoxHTML);
When I have implemented this the text box is adding at all the places wherever I am using the dialog.
But my requirement is that I want to add this text box to only one scenario of my application, means that I have used dialog box at several places, but need to add at only one place.

Is there any option
HTML
$(".LASERAction").dialog({
});

in this method so that we can add our own code to the dialog wherever we needed.

Thanks.
Posted

1 solution

No, the way you'll want to handle this is to write your own function that wraps the call to $(".LASERAction").dialog({ with your own logic. Then your function can take a parameter which allows you to then decide if you want to add the extra textbox or not.

Something like:
JavaScript
function CustomDialog(AddTextBox)
{
if (AddTextBox)
{
...
}
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900