Question: ```
<script type="text/javascript"> 
function check_phone(){
    var x=$('#phone1').val();
    var landline = /^([0-9]{4}[\-]{1}[0-9]{7})$/;
    var mobile = /^(?:\([2-9]\d{2}\)\ ?|[2-9]\d{2}(?:\-?|\ ?))[2-9]\d{2}[- ]?\d{4}$/;
    if (landline.test(x))
alert('first condition');
        $('#phone1').css('border','2px solid #00a500');
    else if(mobile.test(x))
alert('second condition');
        $('#phone1').css('border','2px solid #00a500');
    else
        $('#phone1').css('border','2px solid #a50000');
alert('third condition');
}
</script>

<input type="text" value="" name="phone1" id="phone1" onchange="check_phone()" required />

```

When I press tab after entering a phone number, it does not show the alert boxes from check\_phone() function. Is it even entering the function and checking it? It does not even style the textbox as per the css mentioned in the function. How can I find out? Please help

Answer: 
From the `RelativeLayout` doc:

> 
> Class Overview
> 
> 
> A Layout where the positions of the children can be described in relation to each other or to the parent.
> 
> 
> Note that you cannot have a circular dependency between the size of the RelativeLayout and the position of its children. **For example, you cannot have a RelativeLayout whose height is set to WRAP\_CONTENT and a child set to ALIGN\_PARENT\_BOTTOM**
> 
> 
> 

[Class documentation](http://developer.android.com/reference/android/widget/RelativeLayout.html)

Which is exactly your case. RelativeLayout can not do that.
This is some kind of Strange issue. Maybe someone else has the explanation. 

I found it working when i removed the line

```
android:layout_alignParentBottom="true"/>

```

and it also worked when i tried some like this

```
<TextView
    android:layout_width="match_parent"
    android:layout_alignParentTop="true"
    android:layout_height="wrap_content"/>

```