Reputation: 11861
I am creating a input text box using jquery:
<input type='text' name='" + key + "-" + taskArray[i] + "' id='" + key + "-" + taskArray[i] + "' class='vendorDropdown' value='" + value.baseOrSchedStartList[i] + "' />
when Anthony's Excavating & Grading
it returns Anthony
how do I get to display the full text, here is what it looks like in html:
<input type="text" name="ANC0002-Water & Sewer Installed" id="ANC0002-Water & Sewer Installed" class="vendorDropdown ui-autocomplete-input" value="Anthony" s="" excavating="" &="" grading'="" autocomplete="off">
Upvotes: 2
Views: 751
Reputation: 1991
try this , use value=\""+mvalue+"\"
<input type='text' name='" + key + "-" + taskArray[i] + "' id='" + key + "-" + taskArray[i] + "' class='vendorDropdown' value=\"" + value.baseOrSchedStartList[i] +"\" />
in this way you can use special characters and spaces also
Upvotes: 1
Reputation: 988
replace single quote( ' ) with double quote( " ), it will solve your issue.
<input type="text" name="' + key + '-' + taskArray[i] + '" id="' + key + '-' + taskArray[i] + '" class="vendorDropdown" value="' + value.baseOrSchedStartList[i] + '" />
Upvotes: 1