[thelist] javascript: passing events

Hans Fraser hfraser at videotron.ca
Thu Feb 20 11:29:29 CST 2003


>
>     If at all possible, set the status of your checkboxes server-side.
> If
> for some reason this isn't possible, use the onload event for the
> document
> and loop through the form's elements collection; whenever the loop
> hits a
> form element of type "checkbox", validate whether that element is in
> the
> array of checkboxes that should be checked. But again, this really
> should be
> done server-side.
>

I really would love to do this check server side but it is not an
option!

this is wat the system does
it is a flexible reference system buit to handle bibliographies,
webographies, lexicons ...
well mostly any reference system!

the relation ships are many to many a bibliography can contain any
number of books but those books can also be present in any bibliography
and bibliographies themselves can be present in other bibliographies.

when you edit an allready created bibliography or create one you can
attach books to it you click a link and a window pops up with a search
interface (there are just to many books in it allready to show them
all) you do your search and a list of books come up when you select a
book it adds its id to an array in the biblio window that called it or
removes itself if it is allready in the array but you do not necessarly
have all the books that are attached to the biblio present.

and the server does not know what books have been newly attached to the
biblio since it is not yet saved only the array knows!

this is why i need it that way!

i think I will just make a dirty fix and put something like this at the
end of the body!

<script language="JavaScript" type="text/JavaScript">
var myResultArray = new Array('1','2','3','4'); // array of the
element's id return by the server
for(var i = 0; i < myResultArray.length; i++){
	window.opener.checkRefElement(document.getElementById('check'+
myResultArray[i]), myResultArray[i]);
}
</script> 

Hans-Frédéric Fraser



More information about the thelist mailing list