Hello,
I know my title isn't very descriptive but have one webpage that you click table data's that have words in them and they switch what is in the main screen (instead of having links for 5-10 differnt pages (overexageration on the pages). Well Doing this i have a lot of getelementbyid's changing visibility and hidden's I was wondering if i can take these getelementybyid's and use them in a external CSS so that way i don't have a bunch of them in my main html. For Example:
-------------------------------------------------------------------------
<td width="12%"
onclick= "document.getElementById('home').style.visibility='visible';
document.getElementById('login').style.visibility='hidden';
document.getElementById('register').style.visibility='hidden';
document.getElementById('booklist').style.visibility='hidden';
document.getElementById('deletebook').style.visibility='hidden';
document.getElementById('displaybooks').style.visibility='hidden';">Home</td>
-------------------------------------------------------------------------------------------
I was wondering if i could make a table.showhome CSS class and put these in them in my external CSS file... or if there was a way to do this, to get rid of the clutter from my main html file.
I have them goign invisible and visible becuase there all positioned at the same spot so if i did nto they would be overlapping each other and would make NO sense. I have been looking online and have not found anything as of yet. I tried just copying them in, but becuase they are javascript functions (or at least as far as i understand) they can not be put in a CSS (as far as i understand). Any help would be appreciated , each element btw is just a id that points to visbility = hidden or true in a CSS external file, as well as some positioning information.
Thanks for your help ,
Kamron
P.S. - also login is a obviously lgoin page where someone would put in there username and password, if they put it in wrong is there a way to have the form go back to the immediate page with the specific ID information visible so it doesnt' go to the home page automatically with a message that says "Wrong username or password, please register if you are not logged in" or something, or will i just have to have the page regenerated in php everytime i need to submit a form.
I know my title isn't very descriptive but have one webpage that you click table data's that have words in them and they switch what is in the main screen (instead of having links for 5-10 differnt pages (overexageration on the pages). Well Doing this i have a lot of getelementbyid's changing visibility and hidden's I was wondering if i can take these getelementybyid's and use them in a external CSS so that way i don't have a bunch of them in my main html. For Example:
-------------------------------------------------------------------------
<td width="12%"
onclick= "document.getElementById('home').style.visibility='visible';
document.getElementById('login').style.visibility='hidden';
document.getElementById('register').style.visibility='hidden';
document.getElementById('booklist').style.visibility='hidden';
document.getElementById('deletebook').style.visibility='hidden';
document.getElementById('displaybooks').style.visibility='hidden';">Home</td>
-------------------------------------------------------------------------------------------
I was wondering if i could make a table.showhome CSS class and put these in them in my external CSS file... or if there was a way to do this, to get rid of the clutter from my main html file.
I have them goign invisible and visible becuase there all positioned at the same spot so if i did nto they would be overlapping each other and would make NO sense. I have been looking online and have not found anything as of yet. I tried just copying them in, but becuase they are javascript functions (or at least as far as i understand) they can not be put in a CSS (as far as i understand). Any help would be appreciated , each element btw is just a id that points to visbility = hidden or true in a CSS external file, as well as some positioning information.
Thanks for your help ,
Kamron
P.S. - also login is a obviously lgoin page where someone would put in there username and password, if they put it in wrong is there a way to have the form go back to the immediate page with the specific ID information visible so it doesnt' go to the home page automatically with a message that says "Wrong username or password, please register if you are not logged in" or something, or will i just have to have the page regenerated in php everytime i need to submit a form.