473,386 Members | 1,803 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,386 software developers and data experts.

modify an input area in a form

I have the following arrangement working under Netscape 3 / Unix, IE6 /
Win and Konqueror / Linux, but NOT under Netscape 7 Unix or Mozilla
Linux (silently fails) nor under Netscape 4 Unix (fails with message
"access disallowed from scripts at XXXX to documents at another
domain").

1) I have a frameset http://host/PATH/pinco,html in whose HEAD I
define javascript functions like :

function changeItem(i,v) {
top.frames["UP"].document.myform.elements[i].value = v ;
}

2) the upper frame of the frameset contains a page
http://host/PATH/pincoform,html containing a form, whose
action is a java servlet http://host:8080/servlet/myStuff

the form contains a table of input areas

<td><input name="item01" size=3 maxlength=5 value=" "></td>
<td><input name="item02" size=3 maxlength=5 value="0"></td>
...
<td><input name="item10" size=3 maxlength=5 value="0"></td>

(contains also several checkboxes, radiobuttons etc.)

3) in one usage mode, the user enters a number in the first
input area, and clicks on a Load button. This calls the Java
servlet, which searches a mysql database for records where
acertaincolumn=number

4) the servlet writes into the lower frame. In the simplest case
(single entry match in the database), it writes some
javascript code and some HTML

<SCRIPT>
top.frames['UP'].document.myform.reset()
parent.changeItem(1,wishednumber)
parent.changeItem(2,areturnedvalue)
...
parent.changeItem(10,anothervalue)
</SCRIPT>
loading completed for source wishednumber

the result is to load into the cells of the form in the upper frame
the returned values (it also ticks some of the checkboxes /
radiobuttons)

5) I use javascript code generated by the Java servlet to modify the
form content, instead of generating the entire HTML code of the
upper frame from within the servlet, for simplicity and convenience

the same servlet can manage (WITHOUT modifications to the code) a
couple of different framesets and forms (e.g. http://host/PATH/pinco,html
and http://host/PATH/panco,html, http://host/PATH/pincoform,html and
http://host/PATH/pancoform,html)

All parametric peculiarities (mysql table name. number and name of
mysql columns) are in fact hardcoded as hidden fields
in the form, and I do not need to recompile the servlet if I change
something.

All this thing is intended for use by a small number of users (3-4)
however located in different places.

In the error message of Netscape 4 "access disallowed from scripts at
XXXX to documents at another domain", XXXX is the name of the java
servlet. Excepted the use of port 8080, the servlent is on the same
host as the web pages.

I gather (google) that the message refers to a security device to avoid
a "pirate" javascript modifying a form, but my intended usage is wished
and legitimate.

I can't find a way to disable this behaviour at "browser preferences"
level for Netscape 4, 7 and Mozilla (the browser which my correspondents
intend to use)

a) CAN one disable this behaviour at browser level ?

b) can it be bypassed otherwise ?

c) is the above diagnosis correct, or is there another problem
(e.g. timing ? ... in other cases I had a CGI [shell]
script updating the GIF loaded as image[xyz].src, and I noticed
that a delay at javascript level was required, of the sort
t=setTimeout('parent.ctrl.location.reload()',1500)

--
----------------------------------------------------------------------
no****@mi.iasf.cnr.it is a newsreading account used by more persons to
avoid unwanted spam. Any mail returning to this address will be rejected.
Users can disclose their e-mail address in the article if they wish so.

Jul 20 '05 #1
1 2035


LC's No-Spam Newsreading account wrote:

I can't find a way to disable this behaviour at "browser preferences"
level for Netscape 4, 7 and Mozilla (the browser which my correspondents
intend to use)

a) CAN one disable this behaviour at browser level ?

b) can it be bypassed otherwise ?

c) is the above diagnosis correct,


Yes, see
http://www.mozilla.org/projects/secu...me-origin.html
for Mozilla respectively Netscape 6/7, its same origin policy regards
pages as having different origins if the port is different.
I don't think you can change that.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2

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

Similar topics

16
by: Philippe C. Martin | last post by:
Hi, I am trying to change the data in a form field from python. The following code does not crash but has no effect as if "form" is just a copy of the original html form. Must I recreate the...
2
by: Mike | last post by:
Hi I have been tasked with converting my pulp and paper mills weekly projected and actual contractor hrs excel spreadsheet into a an Access 97 database. So far my design has been to use a...
4
by: Jason Cowsill | last post by:
Hi - I am looking for a way to dynamically alter a textbox WHILE the user is typing in it. One example would be while a user is entering their phone number a dash would be entered automatically...
11
by: tlyczko | last post by:
Hello Rob B posted this wonderful code in another thread, http://groups.google.com/group/comp.lang.javascript/browse_thread/thread/c84d8538025980dd/6ead9d5e61be85f0#6ead9d5e61be85f0 I could not...
3
by: aurora | last post by:
This is an entry I just added to ASPN. It is a somewhat novel technique I have employed quite successfully in my code. I repost it here for more explosure and discussions. ...
3
by: cbradio | last post by:
Hi, I am having trouble developing a form in a restricted environment. My sample code is found below my message (sorry I don't have a URL). Basically, without a doctype, the form displays properly...
4
by: ckirchho | last post by:
Hallo, In a form I have several text or checkbox inputs with their appropriate labels. I'd like to keep label and input together, so I connect them with a &nbsp;, like: <input type="checkbox"...
0
by: karen987 | last post by:
Could someone please tell me what code to add here? I have a weblog, with daily news which readers can add comments to, which are stored in a database. The form to add the comments is on an ASP page,...
2
by: creative1 | last post by:
I get following error on page : Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\desiorb\411.php:9) in C:\xampp\htdocs\desiorb\411.php on line 21 when...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.