Solved

How to redraw a form using javascript...

Posted on 1998-01-06
6
657 Views
Last Modified: 2012-05-04
Dear Friends,

I created a form which has multiple selection boxes.  When
you select data from one selection box, it updates others
boxes.  The problem comes in in the PC platform; when you the boxes which got updated do not resize.  They keep the initial size as first loaded.  Because I'm using mutiple frames for some other purposes, I can NOT using history.go(0) or reload() functions to repaint the page.  

Do you have any surgestion how to solve this problem?
I'm using Netscape 3.x, 4.x by away...

Thanks for you help...
--
hkd
0
Comment
Question by:hkd
6 Comments
 

Author Comment

by:hkd
ID: 1277349
Edited text of question
0
 
LVL 10

Expert Comment

by:kollegov
ID: 1277350
Have you tried history.go(0), I'm sure this
is only redraw windows, but do not reload frameset.
As I remember, Netscape server download area document
implements exactly this function to redraw
form in frameset.
0
 

Author Comment

by:hkd
ID: 1277351
the problem with history.go(0) was:  I created a active frame and
a hidden frame.  After user fill out the form in active frame, he/she clicks on submit button and it submits to the hidden frame.  the hidden frame then calls my cgi to update data and using hidden frame to update new data to active frame.  After data has been updated in the active frame, I have to redraw the frame by calling history.go(0).  Yes the history.go(0) did redraw the page, but the new data that hidden frame updated in javascript objects didnot get updated.  Only javascript objects in the form property got updated.

Any idea why?  

--
hkd
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 10

Expert Comment

by:kollegov
ID: 1277352
Quote:
"but the new data
that hidden frame updated in javascript objects didnot get updated. Only javascript objects in the
form property got updated. "

What objects you mean?
Well, suppose your page CREATE some objects
while loading.
It will RECREATE it while RELOADING.
In this way, what values/variables it will use to recreate
this objects? Ones, you have build in script texts?
You will have old objects....
0
 
LVL 2

Expert Comment

by:rigansen
ID: 1277353
to consider:

as far as I know history.go(0) will only redraw the current frame, to reload some other frame(s) you have to use:
   parent.theFrame.history.go(0);
for every frame you want to redraw!!


to keep in mind:

using history.go(0) will make some javascript variables to get lost... maybe that's why your variables at the hidden frame doesn't seem to be updated!! :(


to be sure of:

what do you mean by "They keep the initial size..."?? you mean the horizontal size (string length) or the vertical size (number of items)??


to see what's going on:

advice: try posting some code...


rigansen.
0
 
LVL 2

Accepted Solution

by:
yyyannag earned 0 total points
ID: 1277354
If history.go(0) doesn't work, there is a way of redrawing this form. however, this is quite a long and no so professional way.
the professional way is to use history.go(0).

Here it goes :


In the hidden frame, build two dynamic arrays (don't enter number of elements of the array : var a=new Array();).
enter in one array the default names of the multiple selection box, and in the other, the values of the selection box.

In the main frame, build a JS function that reads the arrays, and uses the "new Option" statement to draw the selection box. after clicking the submit button, the function will give new values to the hidden arrays, according to the proper values of the selection boxes. then, reload the frame (NOT the page!).


Like I said, this is not a very good way, but it serves its cause.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question