anonnerz Posted July 11, 2006 Share Posted July 11, 2006 I've been trying for ages to be able to set textarea values in firefox to no avail. It just doesn't register the textarea... Any help?Here is the relevant codes:From the javascript file:[code]function set(toset, img, iid, thelink) { link = thelink; do_id = iid; document.main.src = img + '&x=300&y=300'; Image_Desc.value = toset; }[/code]The image setting it (it's an onmousedown... as you can see)[code] onMouseDown=" set('{$this->sql_fetch[desc]}', 'image_resize.php?src=uploads/{$this->sql_fetch[File]}', '{$this->sql_fetch[id]}', 'uploads/{$this->sql_fetch[File]}'); setCookie('page_{$this->sql_fetch[Item_ID]}','{$this->sql_fetch[File]}', '6'); setCookie('page_{$this->sql_fetch[Item_ID]}_desc', '{$this->sql_fetch[desc]}', '6'); setCookie('page_{$this->sql_fetch[Item_ID]}_x','300', '6'); setCookie('page_{$this->sql_fetch[Item_ID]}_y','220', '6'); setCookie('page_{$this->sql_fetch[Item_ID]}_link','uploads/{$this->sql_fetch[File]}', '6')" >[/code]The textarea:[code]<textarea name="Image_Desc" cols="30" readonly align=left style='height: 200px;'><?if (file_exists('Uploads/'.$_COOKIE[$cookie])) { echo stripslashes($_COOKIE['page_'.$_GET[id].'_desc']); } else if(!file_exists('Uploads/'.$_COOKIE[$cookie])) { echo $Pic_Viewer->first_image[desc]; } ?></textarea>[/code]It all works in IE but firefox doesn't like it. Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/14253-textareavaluex-not-working-in-firefox/ Share on other sites More sharing options...
anonnerz Posted July 11, 2006 Author Share Posted July 11, 2006 Thanks for looking if you came, fixed it.For others with similar problem you have to put the text area in a form and refer to that form via document.form.textarea.value (with relevant values supplementing form and textarea of course).Thanks =D Quote Link to comment https://forums.phpfreaks.com/topic/14253-textareavaluex-not-working-in-firefox/#findComment-56009 Share on other sites More sharing options...
Daniel0 Posted July 11, 2006 Share Posted July 11, 2006 You can also use the id tag along with the javascript function getelementbyid() Quote Link to comment https://forums.phpfreaks.com/topic/14253-textareavaluex-not-working-in-firefox/#findComment-56284 Share on other sites More sharing options...
obsidian Posted July 11, 2006 Share Posted July 11, 2006 they underlying problem is that the textarea has no value property, so you're better off to use the innerHTML attribute instead. Quote Link to comment https://forums.phpfreaks.com/topic/14253-textareavaluex-not-working-in-firefox/#findComment-56294 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.