Link to home
Start Free TrialLog in
Avatar of Boopathy S
Boopathy SFlag for India

asked on

Need to create window dialog box using jQuery

I'm new to this jQuery, I want to create the dialog box using jQuery, if the empty column occurs. I have tried one method as like below

var apiHost = "";
var apiResUrl = "/v1/resources";
var apiAddNewEmployee = "/addemployee";
var dialog = "/dialog"
var data = $(newEmpForm).serializeArray();
$(".successMSG").hide();
$(".errorMSG").hide();
$.ajax({
url: apiHost + apiResUrl + apiAddNewEmployee,
type: 'POST',
data: JSON.stringify(data),
headers: { token: $.cookie('token') },
contentType: "application/json",
error: function(err) {
$( "#dialog" ).dialog();
}

Open in new window

In Html I tried as like:
<div id="dialog">
<div>
<p>Empty won't allow</p>
</div>
</div>

Open in new window


I'm getting the output in the UI is:

refer IMAGES123.JPG

How I can create the box with text, in the css also tried, but not getting the window box. Please suggest me some idea and please provide some coding for creating the window dialog box also. Thanks in advance
images123.jpg
ASKER CERTIFIED SOLUTION
Avatar of HainKurt
HainKurt
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Chris Stanyon
Be aware that an AJAX error only occurs if there is an actual error making your AJAX request (server error / file not found etc). It does NOT generate an error because of your business logic. If you manage to pass the data to the server for processing, then it will fire the success handler. It's up to you to then decide whether the response from the server should be treated as a success or a failure (often by examining the data that is passed back from the server).

In your example, an empty column would be validated at the server side, so the AJAX call would be successful.
Avatar of Boopathy S

ASKER

Thanks