jQWidgets Forums

jQuery UI Widgets Forums Grid whitespaces in checkbox values

Tagged: 

This topic contains 1 reply, has 1 voice, and was last updated by  ashwin prabhu 9 years, 9 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • whitespaces in checkbox values #74146

    ashwin prabhu
    Participant

    I have a very odd error. Here is the output of a array if i do a console.log(array);

    [" TRUE ", " FALSE "]

    I want the output to be

    ["TRUE", "FALSE"]
    There should not be any whitespaces between the quotes. I hope you get my point. so the array elements doesnt have spaces actually.

    Could anyone pls let me know how to remove the whitespace. If there are whitespaces between the double quotes, i am not able to display the details to checkbox in jqgrid.

    whitespaces in checkbox values #74147

    ashwin prabhu
    Participant

    got the answer. this might help someone

    var array = [" TRUE ", " FALSE "]
    for(var i=0; i< array.length; i++) {
        array[i] = array[i].trim();
    }
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.