Wrox Programmer Forums
|
Java Basics General beginning Java language questions that don't fit in one of the more specific forums. Please specify what version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 7th, 2009, 02:31 AM
Registered User
 
Join Date: Aug 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default function problem

I have a problem This is my code:

<html>
// this function is for table effect. When you have onmouse over its diferent color and when you click become red row.!!!

<style type="text/css">
/* These classes are used by the script as rollover effect for table 1 and 2 */
.tableRollOverEffect1{
background-color:#cdffff;
color:black;
}
.tableRollOverEffect2{
background-color:#cdffff;
color:#black;
}
.tableRowClickEffect1{
background-color:#ff0000;
color:#FFF;
}
.tableRowClickEffect2{
background-color:#ff0000;
color:#FFF;
}
</style>
<script type="text/javascript">
var arrayOfRolloverClasses = new Array();
var arrayOfClickClasses = new Array();
var activeRow = false;
var activeRowClickArray = new Array();
function highlightTableRow()
{
var tableObj = this.parentNode;
if(tableObj.tagName!='TABLE')tableObj = tableObj.parentNode;

if(this!=activeRow){
this.setAttribute('origCl',this.className);
this.origCl = this.className;
}
this.className = arrayOfRolloverClasses[tableObj.id];
activeRow = this;
}

//Here i need to give a function wich send an ID
function clickOnTableRow()
{
var tableObj = this.parentNode;
if(tableObj.tagName!='TABLE')tableObj = tableObj.parentNode;
if(activeRowClickArray[tableObj.id] && this!=activeRowClickArray[tableObj.id]){
activeRowClickArray[tableObj.id].className='DOGODEK_ID';
}
this.className = arrayOfClickClasses[tableObj.id];
activeRowClickArray[tableObj.id] = this;
}
function resetRowStyle()
{
var tableObj = this.parentNode;
if(tableObj.tagName!='TABLE')tableObj = tableObj.parentNode;
if(activeRowClickArray[tableObj.id] && this==activeRowClickArray[tableObj.id]){
this.className = arrayOfClickClasses[tableObj.id];
return;
}
var origCl = this.getAttribute('origCl');
if(!origCl)origCl = this.origCl;
this.className=origCl;
}
function addTableRolloverEffect(tableId,whichClass,whichCla ssOnClick)
{
arrayOfRolloverClasses[tableId] = whichClass;
arrayOfClickClasses[tableId] = whichClassOnClick;
var tableObj = document.getElementById(tableId);
var tBody = tableObj.getElementsByTagName('TBODY');
if(tBody){
var rows = tBody[0].getElementsByTagName('TR');
}else{
var rows = tableObj.getElementsByTagName('TR');
}
for(var no=0;no<rows.length;no++){
rows[no].onmouseover = highlightTableRow;
rows[no].onmouseout = resetRowStyle;
if(whichClassOnClick){
rows[no].onclick = clickOnTableRow;

}
}
}
</script>

<script type="text/javascript">
addTableRolloverEffect('myTable','tableRollOverEff ect1','tableRowClickEffect1');
addTableRolloverEffect('myTable2','tableRollOverEf fect2','tableRowClickEffect2');
</script>
<script language="javascript">
//and that is that function wich send ID to another table
function nad(ID, LINK_ID)
{
//alert("crm_dogodek.php?ID=" + ID );
if (LINK_ID != '')
{
self.location.href = 'crm_dogodek.php?ID=' + ID
+'&ID=' + ID;
}
else {
self.location.href = 'crm_dogodek.php?ID=' + ''
+'&POD_ID=' + ID;
}
}
function nazaj(ID)
{
//alert("crm_dogodek.php?ID=" + ID );
self.location.href = 'crm_dogodek.php?ID=' + ID
+'&POD_ID=' +ID;
}
function pod(ID)
{

self.location.href = 'crm_dogodek.php?ID=' + ID
+'&POD_ID=' + ID;
}
function pop(DOGODEK_ID,STRANKA_ID, VRSTA_DOGODKA_ID, DOGODEK_LINK_ID, DATUM_VNOSA, VELJA_OD, VELJA_DO, DATUM_ZAKLJUCKA,OPOMBA ,
DOKUMENT_POT, IME,NAZIV,NAZIV_OCENE)
{

self.location.href = 'crm_update.php?ID=' + DOGODEK_ID
+'&STRANKA_ID=' + STRANKA_ID
+'&VRSTA_DOGODKA_ID=' + VRSTA_DOGODKA_ID
+'&DOGODEK_LINK_ID=' + DOGODEK_LINK_ID
+'&DATUM_VNOSA =' + DATUM_VNOSA
+'&VELJA_OD=' + VELJA_OD
+'&VELJA_DO=' + VELJA_DO
+'&DATUM_ZAKLJUCKA=' + DATUM_ZAKLJUCKA
+'&OPOMBA =' + OPOMBA
+'&DOKUMENT_POT=' + DOKUMENT_POT
+'&IME=' + IME
+'&NAZIV=' + NAZIV
+'&NAZIV_OCENE=' + NAZIV_OCENE;
}
function brisi(DOGODEK_ID,STRANKA_ID, VRSTA_DOGODKA_ID, DOGODEK_LINK_ID, DATUM_VNOSA, VELJA_OD, VELJA_DO,
DATUM_ZAKLJUCKA,OPOMBA ,DOKUMENT_POT,IME,NAZIV,NAZIV_OCENE)
{
//alert("crm_delete?DOGODEK_ID=" + DOGODEK_ID );
self.location.href = 'crm_delete.php?DOGODEK_ID=' + DOGODEK_ID
+'&STRANKA_ID=' + STRANKA_ID
+'&VRSTA_DOGODKA_ID=' + VRSTA_DOGODKA_ID
+'&DOGODEK_LINK_ID=' + DOGODEK_LINK_ID
+'&DATUM_VNOSA =' + DATUM_VNOSA
+'&VELJA_OD=' + VELJA_OD
+'&VELJA_DO=' + VELJA_DO
+'&DATUM_ZAKLJUCKA=' + DATUM_ZAKLJUCKA
+'&OPOMBA =' + OPOMBA
+'&DOKUMENT_POT=' + DOKUMENT_POT
+'&IME=' + IME
+'&NAZIV=' + NAZIV
+'&NAZIV_OCENE=' + NAZIV_OCENE;
}
</script>
Thank you





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with getimagesize function echovue Beginning PHP 1 January 20th, 2007 03:23 AM
Problem with function mat41 Classic ASP Basics 3 July 16th, 2005 01:19 AM
shell function problem bml Excel VBA 1 February 12th, 2005 05:42 PM
sum function problem sherr8 Access 1 February 13th, 2004 03:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.