473,327 Members | 2,016 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

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

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
Jul 23 '05 #1
2 1494
Saravanan K wrote:
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.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #2
Saravanan K wrote:
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.

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: gsb | last post by:
In IE I can send a click event to a form filed with objectName.click(); Is there a way to do this in other browsers like Netscape 6+ and Opera, etc...? Thanks, gsb
11
by: yaktipper | last post by:
This explains how to disable the view source / right-click menu in Netscape 4, Netscape 6 and Internet Explorer (IE). <script language="JavaScript"> //This code is the beginning of the right...
8
by: Bernard Philip | last post by:
hey everybody i have a dropdown list opening a window, ie <SELECT onchange=openwindow()..> <OPTION value=.... <..choice1..> <..choice2..> when clicking on an choice if i clear this window,...
2
by: Smoke | last post by:
Does anyone know of a quick method of inserting records into a text file or database using OnClick?
5
by: Someone | last post by:
I know many don't like having right click disabled, however this is a unique case where clients using viewing this particular site will not be world wide so it's not going to affect too many...
4
by: Fluffy Convict | last post by:
I have found a workaround to disable certain options in an option list: var p = document.forms.elements; p.selectedIndex=-1; This works perfectly in IE - the selectedIndex becomes unclickable....
4
by: Old Lady | last post by:
Hi, I need help! I have a SELECT/OPTION list. My goal is to have a TEXT input field in a form that is normally disabled, but it should become enabled when the user select one predefined OPTION....
7
by: Robert | last post by:
Can I programmatically disable the right click context menu?
1
by: kebabkongen | last post by:
Hi, I'm working on a JavaScript that is enabling / disabling a select element according to whether a checkbox is selected or not. This works fine in Firefox, but in Internet Explorer (v 6.0.2900)...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.