web: CSS - Java - JavaScript
Java and JavaScript receipes and documentation
Documentation
- Here are some quick recipies in javascript at http://developer.irt.org/script/frame.htm
- Also here there is some more http://www.xulplanet.com/
- I was using devedge.netscape.com but it’s not seem to be online anymore, it’s cached on google at http://web.archive.org/web/*/http://devedge.netscape.com/ or at http://web.archive.org/web/*/http://devedge.netscape.com/ or http://www.mozillaquest.org/?article_date=2004-10-11+23-35-14
- A good mix with JavaScript is the use of CSS. There is a good site on it: http://www.meyerweb.com/eric/css/edge/
- IFrames explainer with examples http://www.dyn-web.com/dhtml/iframes/
- Another good place about all this stuff is http://www.w3schools.com/default.asp
Download
Java environnement http://www.java.com/en/download/manual.jsp
How to open a search windows and return result in a form Function to open the window
<a href=“#” onClick=“open_window_recherche(usager.sta_id,’recherche_usager.php’);” class=“normal”>Rechercher</a>
Function to return the value
function selection_usager()
{
var sta_id = document.recherche.sta_id.value;
if(sta_id == -1)
{
alert(’Vous devez sélectionner un usager dans la liste !’);
}
else
{
window.opener.location.href = “config_utilisateurs.php?sta_id=”+sta_id;
this.close();
}
}// fin function selection_usager
How to move items from a list into another code snippet
function add_institution()
{
var index = document.usager.inst_disponible.selectedIndex;
if(index != -1)
{
if(document.usager.inst_disponible.options[index].value != -1)
{
var temp = new Option(document.usager.inst_disponible.options[index].text, document.usager.inst_disponible.options[index].value, false, false);
document.usager.inst_usager.options[document.usager.inst_usager.length] = temp;
document.usager.inst_disponible.remove(document.usager.inst_disponible.selectedIndex);
}
}
}// fin add_institution()
function sub_institution()
{
var index = document.usager.inst_usager.selectedIndex;
if(index != -1)
{
if(document.usager.inst_usager.options[index].value != -1)
{
var temp = new Option(document.usager.inst_usager.options[index].text, document.usager.inst_usager.options[index].value, false, false);
document.usager.inst_disponible.options[document.usager.inst_disponible.length] = temp;
document.usager.inst_usager.remove(document.usager.inst_usager.selectedIndex);
}
}
}//fin sub_institution
The function could be called within any object that support < onclick=”" > property.
Html code look like this:
<select name=“inst_usager” size=“8″ >
<option value=“-1″>Centres de l’usager</option>
</select>
<img src=“images/puce_gauche.gif” onClick=“add_institution()” >
<img src=“images/puce_droite.gif” onClick=“sub_institution()” >
<select name=“inst_disponible” size=“8″ >
<option value=“-1″>Centres disponible</option>
<option value=“546321″ >Centre hospitalier #1</option>
<option value=“987654″ >Centre hospitalier #2</option>
<option value=“987658″ >Centre hospitalier #3</option>
<option value=“888888″ >Centre hospitalier #4</option>
<option value=“123654″ >Centre hospitalier #5</option>
</select>
Using session parameters (to validate login)
Here are an example