Right click option is not disabled in the Text filed in Netscape 4.7

S

Saravanan K

Hi,


I am having a problem with right click option with Netscape 4.7. I
am unable to make the Text field read-only using the Onfocus =
"this.blur()" but user is able to use the right click option which
will open the edit menu (popup menu) and he is able to cut, copy paste
options.

Please send me solution for this.

Thanks in Advance

Saravanan.K
 
R

Randy Webb

Saravanan said:
Hi,


I am having a problem with right click option with Netscape 4.7. I
am unable to make the Text field read-only using the Onfocus =
"this.blur()" but user is able to use the right click option which
will open the edit menu (popup menu) and he is able to cut, copy paste
options.

Please send me solution for this.

Solution: Stop f**king with my mouse. Now, it works.

But if you want it readonly, hide it. Then it can't be edited.
 
G

Grant Wagner

Saravanan said:
Hi,

I am having a problem with right click option with Netscape 4.7. I
am unable to make the Text field read-only using the Onfocus =
"this.blur()" but user is able to use the right click option which
will open the edit menu (popup menu) and he is able to cut, copy paste
options.

Please send me solution for this.

There is none. The user can always change the value in a visible input in
Netscape 4.7. They can disable client-side JavaScript and change the
value. They can type
"javascript:void(document.forms['formname'].elements['elementname'].value='theirValue');"
in the address bar.

You can attempt to circumvent the user changing the value of an input with
something like:

<form>
<input type="text"
name="input1"
value="This is a test"
onchange="this.value=this.form.elements[this.name + 'Hidden'].value;"
onfocus="this.blur();"
readonly="readonly">
<input type="hidden"
name="input1Hidden"
value="This is a test">
</form>

Or:

<body onload="rememberTextValues();">
<script type="text/javascript">
function rememberTextValues() {
var f, el;
if (f = document.forms) {
var ii = f.length;
while (ii-- > 0) {
if (el = f[ii].elements) {
var jj = el.length;
while (jj-- > 0) {
if (el[jj].type == 'text') {
el[jj].originalValue = el[jj].value;
}
}
}
}
}
}
</script>
<form>
<input type="text"
name="input1"
value="This is a test"
onchange="this.value=this.originalValue;"
onfocus="this.blur();"
readonly="readonly">
</form>

But when all is said and done, you _must_ _must_ _must_ validate the value
of inputs after they are submitted to the server. In other words, don't
trust that <input type="text" name="unitPrice" value="$1000000.00"
readonly="readonly"> will guarantee that the unit price is $1000000.00
when the form is submitted.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top