# Make share input field readonly

**URL:** <https://meta.discourse.org/t/make-share-input-field-readonly/18973>\
**Category:** Feature\
**Created:** [August 17, 2014, 11:10pm UTC](https://meta.discourse.org/t/make-share-input-field-readonly/18973 "2014-08-17T23:10:27Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![Lid](https://avatars.discourse-cdn.com/v4/letter/l/2bfe46/32.png) [@Lid](https://meta.discourse.org/u/Lid)\
**Post date:** [September 8, 2014, 7:21am UTC](https://meta.discourse.org/t/make-share-input-field-readonly/18973/4 "2014-09-08T07:21:44Z")

</div>

There are few other possible workarounds

###option 1  
1.I can’t really test it on iPad, but even chrome on android presented the same issue for me,  
A Textarea workaround seem to work on it, if thereported behavior in the link below is correct on iPad as well, then using the textarea trick could work on mobile safari too.

> [http://www.willcodeforequity.com/blog/2011/1/18/mobile-safari-ignores-textarea-readonly-attribute.html](http://www.willcodeforequity.com/blog/2011/1/18/mobile-safari-ignores-textarea-readonly-attribute.html)

You can also try and test it pasting this executable url in the address bar of your device  
open a topic  
paste the following in the address bar  
scroll to the bottom topic share button  
you will see the share box open and the input should be selected and and selectable

I tested the following on my N4 and allowed me to select and copy, but copy button UI was not triggered by this code.

```plaintext

javascript:$("button[title='share a link to this topic']").click();$("#share-link div > textarea").remove();$("#share-link div > input").hide();$("#share-link div > input").before ('<textarea id="t_area_1" readonly="" style="font-size: 16px;margin-bottom: 10px;cursor: text;background-color: #fff;width: 96%;resize: none;height: 18px;white-space: nowrap;overflow: hidden;">' + $("#share-link div > input").val() + '</textarea>');setTimeout(function(){$("#t_area_1").select();},1000);

```

###Option 2  
2.Use javascript to prevent all key press/down except: Ctrl+c Ctrl+a, Shift + left/right, left/right, home/end and Esc  
instead of the css approach

---

_[View the full topic](https://meta.discourse.org/t/make-share-input-field-readonly/18973)._
