Jump to content
mickeymouse

Java code not producing result.

Recommended Posts

Upon loading, the code works.  My form area get highlighted with yellow.

In the second case, Java goes through the code but my area does not get highlighted.

I also tried calling myload function but that also didn't work - maybe not doing it the right way.

<style type='text/css'>
.start-here {background-color: yellow;}
</style>
<script type='text/javascript'>
//=======================================
function myload()                        //This code does it's job of highlighting my form starting at field 'all'
{var c = document.ReportsForm.all;
	c.focus();
	c.parentNode.className = 'start-here';
	c.onblur = function()
	{this.parentNode.className = '';}
}
//======================================
function formcheck(myform)
{if (all.checked || .checked || liab.checked || inc.checked || exp.checked){;}
	else {alert('A Type of Account must be selected.');  //This alert takes place.
        	var c = document.ReportsForm.all;            // this code has no results
        	c.focus();									 //		"
        	c.parentNode.className = 'start-here';       //		"
        	c.onblur = function()                        //		"
        	{this.parentNode.className = '';}            //		"
            alert('TEST IF REACHED');                   //This alert takes place.
        	return false
         }
}
//===============================================
function formcheck(myform)
{if (all.checked || .checked || liab.checked || inc.checked || exp.checked){;}
	else {alert('A Type of Account must be selected.');  //This alert takes place.
        	window.myload()                              //This did not result in highlighting.
        	return false
         }
}  

 

Share this post


Link to post
Share on other sites

Have you checked your JavaScript console for errors? It may give you a clue as to what's going on.

Share this post


Link to post
Share on other sites

Which browser are you using?

You're usually able to get the console by going into the Browser developer tools. On Chrome that's F12

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...