Doesn't pass 'read only' text fields...

User 2159832 Photo


Registered User
58 posts

I have found some code that may help but I'm not sure how to implement it into my form code.
http://jsfiddle.net/raunakkathuria/67ggg/
User 187934 Photo


Senior Advisor
20,271 posts
Online Now

Alter the myvariable_name to your field name. You can use the starts with to catch multiple fields if their setup that way. Otherwise you'll add each one seperatly.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('input[name=myvariable_name1').attr('readonly', true);
$('input[name=myvariable_name2').attr('readonly', true);
$('input[name=myvariable_name3').attr('readonly', true);
});</script>


This would catch all fields starting with myvariable_name
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('input[name^=myvariable_name').attr('readonly', true);

});</script>
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2159832 Photo


Registered User
58 posts

Thanks Steve, I'll have to wait to later this afternoon to play with this and I'll get back with how it went.

Again... Thanks!
User 2159832 Photo


Registered User
58 posts

Oh one quick question. What is the property of the field that myvariable_name is applied to? The id?
User 187934 Photo


Senior Advisor
20,271 posts
Online Now

The field name
Who's Steve.:lol:
Maurice Dykes wrote:
Thanks Steve,
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2484360 Photo


Registered User
3,293 posts

Eric Rohloff wrote:
The field name
Who's Steve.:lol:
Maurice Dykes wrote:
Thanks Steve,


You are John... Do you not even know your own name? :lol:

User 2159832 Photo


Registered User
58 posts

LOL, I was going back and forth with a tech support guy named Steve at my web hosting site regarding an SSL certificate and his name got stuck in my head.

My apologies Eric!

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.