Title: Problem inline label (jQuey)
Last modified: August 19, 2016

---

# Problem inline label (jQuey)

 *  [Axiol](https://wordpress.org/support/users/axiol/)
 * (@axiol)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/problem-inline-label-jquey/)
 * Hi,
 * I’m building my new theme and I’ve a problem. I use jQuey to display the input’s
   label into the input :
 *     ```
       this.label2value = function(){	
   
       	var inactive = "inactive";
       	var active = "active";
       	var focused = "focused";
   
       	$("label").each(function(){
       		obj = document.getElementById($(this).attr("for"));
       		if(($(obj).attr("type") == "text") || (obj.tagName.toLowerCase() == "textarea")){
       			$(obj).addClass(inactive);
       			var text = $(this).text();
       			$(this).css("display","none");
       			$(obj).val(text);
       			$(obj).focus(function(){
       				$(this).addClass(focused);
       				$(this).removeClass(inactive);
       				$(this).removeClass(active);
       				if($(this).val() == text) $(this).val("");
       			});
       			$(obj).blur(function(){
       				$(this).removeClass(focused);
       				if($(this).val() == "") {
       					$(this).val(text);
       					$(this).addClass(inactive);
       				} else {
       					$(this).addClass(active);
       				};
       			});
       		};
       	});
       };
       $(document).ready(function(){
       	label2value();
       });
       ```
   
 * But, the problem is, if, when I submit the comm, there’s not a website url, WP
   uses the label as an URL ([http://YourWebsiteURL](http://YourWebsiteURL)).
 * How can I solve this problem ?
 * Thanks ^^

The topic ‘Problem inline label (jQuey)’ is closed to new replies.

## Tags

 * [comment](https://wordpress.org/support/topic-tag/comment/)
 * [form](https://wordpress.org/support/topic-tag/form/)
 * [input](https://wordpress.org/support/topic-tag/input/)
 * [jquery](https://wordpress.org/support/topic-tag/jquery/)

 * 0 replies
 * 1 participant
 * Last reply from: [Axiol](https://wordpress.org/support/users/axiol/)
 * Last activity: [16 years, 5 months ago](https://wordpress.org/support/topic/problem-inline-label-jquey/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
