Textarea Doesnt Return Value August 03, 2023 Post a Comment Im using a code editor codepress in all of my textareas, but no textarea return a value. I think the different name and id is the problem. Example: Solution 1: Both answers didnt work...In the support forum of codepress i found this:<inputtype="submit" onclick="textareaID.textarea.value = textareaID.getCode();" value="save" /> Copybut i cant understand.Here is the link of discutionSolution 2: This worked for me. If the name and id of the textarea are the same, it breaks the javascript. For the textarea i just assign an ID and I add a hidden input field with the name I wish to collect in the form process; then using the onsubmit to assign the codepress to the hidden input like this:<formaction="something"onsubmit="codeText.value = codeTextArea.getCode();"><textareaid="codeTextArea"rows="20"cols="50"class="codepress java"></textarea><inputtype="hidden"name="codeText"/><inputtype="Submit"></form>CopySolution 3: You need to call textarea_id.getCode()So you probably want something like this:<formaction="something"onsubmit="this.content_hidden = content_text.getCode();"><inputtype="hidden"name="content_hidden"><textareaname="content_text"rows="20"cols="50"class="codepress sql"id="myCpWindow"></textarea><inputtype="Submit"></form>CopySolution 4: no onsubmit you just need to turnoff the codepress<formaction="something"onsubmit="content_text.toggleEditor();"><textareaname="content_text"rows="20"cols="50"class="codepress sql"id="myCpWindow"></textarea><inputtype="Submit"></form>CopySolution 5: = drop the id.Why are your names and id different? (you shouldn't do that in general btw). I assume you're using the name for your stuff and just taking the id because it was on their stuff. While i've never used codepress, most scripts like this (at least, well built ones) will build off of the class (and not the ID) so go ahead and drop the id and see if that works. cheers. Share Post a Comment for "Textarea Doesnt Return Value"
Post a Comment for "Textarea Doesnt Return Value"