We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Add custom placeholder/watermark in textbox on edit or add new row


I want to be able to add a placeholder in a textbox when editing or adding a new row in the grid.

Is there a simple way to do this?


1 Reply

PK Prasanna Kumar Viswanathan Syncfusion Team June 26, 2017 03:07 PM UTC

Hi Steve, 

Thanks for contacting Syncfusion support. 

To add a placeholder in textbox in a row, use actionComplete event of ejGrid. This event will be triggered for every grid success event. In this event we find the input elements of a newly added row and add the placeholder in the textbox. 

Find the code example:  

        .Columns(col => 
        .ClientSideEvents(eve => eve.ActionComplete("complete"))       
    function complete(args) { 
        if (args.requestType == "add" && args.requestType == "edit") { 
            var textboxes = this.element.find(".gridform").find("input"); 
            for (var i = 0 ; i < textboxes.length ; i++) { 
                $(textboxes[i]).attr("placeholder", "Enter Text"); 

Refer to the Help document for the actionComplete event.  

Prasanna Kumar N.S.V 

Live Chat Icon For mobile
Up arrow icon