Click here to Skip to main content
15,881,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
am facing problem while adding an icon in my textbox can any one help out with this.

<script type="text/javascript">
$(document).ready(function() {
$("#add").click(function() {
var intId = $("#buildyourform div").length + 1;
var fieldWrapper = $("");
var fchk = $("<input type="\"checkbox\"" class="\"fieldcheck\"" /> ")
var fName = $("<input type=\"text\" class=\"form-control\" placeholder=\"Username\" />
var removeButton = $("<input type="\"button\"" class="\"remove\"" value="\"-\"" />");
removeButton.click(function() {
$(this).parent().remove();
});
fieldWrapper.append(fchk);
fieldWrapper.append(fName);
fieldWrapper.append(removeButton);
$("#buildyourform").append(fieldWrapper);
});

});

</script>

but the icon displays outside the text box can any one help with this
Posted
Comments
Gihan Liyanage 14-Aug-14 5:06am    
Do you want add the image Dynamically ?

1 solution

Do you want Java script ?

Can't you use just

HTML
<input type="text" style="background-image: url({imageURL});"/>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900