Is there anyway I can make a textbox read-only?

I have a webpage that I am sending a GUID to from a desktop app (

Is there anyway I can make the PayPal on0 textbox read-only so the user doesn't farkel with it?
function getParameterByName(name)
  name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
  var regexS = "[\\?&]" + name + "=([^&#]*)";
  var regex = new RegExp(regexS);
  var results = regex.exec(window.location.href);
  if(results == null)
    return "";
    return decodeURIComponent(results[1].replace(/\+/g, " "));

<form id="myform_id" action="#">
<td><input type="image" src="" border="0" name="submit" /><td style="font-size: smaller;">
<input type="hidden" name="on0" value="GUID">&nbsp;&nbsp;&nbsp;&nbsp;GUID:</td>
<td><input type="text" name="os0" maxlength="100"></td>
<td><img alt="" border="0" src="" width="1" height="1"></td>
var usersGUID = getParameterByName('GUID');
document.forms['myform_id'].elements["os0"].value = usersGUID;

Open in new window

Who is Participating?
Dave BaldwinConnect With a Mentor Fixer of ProblemsCommented:
Yes, see here:  But you may have to use javascript to make it 'readonly' after you put the value in it.
rmmarshAuthor Commented:
Interesting... when I use 'readOnly' or 'disabled', the value does NOT get sent on to PayPal... any ideas why?
Dave BaldwinFixer of ProblemsCommented:
'disabled' is not supposed to be sent.  I would have thought that 'readonly' would work.  It does work in the demo on the link above.  And it works on my own demo pages so I guess you need to check your code.
rmmarshAuthor Commented:
Thank you...
Dave BaldwinFixer of ProblemsCommented:
You're welcome, glad to help.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.