Avatar of CementTruck
CementTruck
 asked on

Need a specific Javascript function on page load

Hello Experts,

I have the following javascript function on my page.

<SCRIPT LANGUAGE="Javascript" TYPE="text/javascript">


function showall()
{
  document.getElementById('showall').style.display = "none";
  document.getElementById('hideall').style.display = "inline";
}

function hideall()
{
  document.getElementById('showall').style.display = "inline";
  document.getElementById('hideall').style.display = "none";
}
</SCRIPT>



On the page I have a form. The form is hidden until the "ShowAll" function is triggered. The form has a table with multiple submit buttons that reorder the columns. Hitting each submit causes the page to reload, thereby causing the form/table to be hidden again.

I also have a Hidden Field that lets me know when the form was submitted.

Here's the question: How do I get the javascript "ShowAll" function to be pervasively "Inline"? I'm trying to do an IF statement on page load that looks for the form.hiddenfield and causes the "ShowAll" function to be the active function. Is this achievable?

Thanks in advance.
JavaScript

Avatar of undefined
Last Comment
leakim971

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
leakim971

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
CementTruck

ASKER
Thank you!
leakim971

You're welcome, thanks for the points!
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck