2

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 &amp; Sewer Installed" id="ANC0002-Water &amp; Sewer Installed" class="vendorDropdown ui-autocomplete-input" value="Anthony" s="" excavating="" &="" grading'="" autocomplete="off">
1
  • you are doing it wrong your name and id of textbox should not content space or any special characters. where name can be same but id must be unique. Commented May 26, 2015 at 14:06

2 Answers 2

1

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] + '" />
Sign up to request clarification or add additional context in comments.

Comments

1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.