mercredi 24 juin 2015

test for null not working

I have a an onclick function, inside this function I want to create a condition for the way some elements are shown in the textarea. added this in the function:

    bPlace = bookForm.txtPlace.value;
    if (bPlace="null") {
        bPlace="!."
    }

bookForm.myText.value = bPlace

according to this condition when the value in txtPlace in myForm is not null it should show anything the user puts in. But when I test it, when I type something, instead of showing that, it still shows the (( !. )) in the textarea.

I should say I used "Undefined" instead of Null and still the same thing happened

Can you please tell me what am I doing wrong?

Aucun commentaire:

Enregistrer un commentaire