Jump Script (Always Up)

I am using a sphere in a 3D Side-Scroller (no forward or backward) and therefore using my own controls, when I jump I can just hold it and keep going up. I need it to be like you cant jump unless on the floor. Here is my script:

var JumpSpeed = 100.0f;

function FixedUpdate() 
{
	//Left
	if(Input.GetKey(KeyCode.LeftArrow) )
	{
		rigidbody.AddForce(Vector3.left*5);
	}
	if(Input.GetKey(KeyCode.A) )
	{
		rigidbody.AddForce(Vector3.left*5);
	}
	//Right
	if(Input.GetKey(KeyCode.RightArrow))
	{
		rigidbody.AddForce(Vector3.right*5);
	}
	if(Input.GetKey(KeyCode.D))
	{
		rigidbody.AddForce(Vector3.right*5);
	}
	//Jump
	
	if(Input.GetKey(KeyCode.W))
	{
		Jump();
	}
}
function Jump()
{
		animation.Play("jump_pose");
		rigidbody.velocity += Vector3.up * JumpSpeed;
}

For an object with rigidbody

    if(Input.GetKeyDown(KeyCode.W))
    {
        Jump();
    }
 }
        
 function Jump()
 {
    animation.Play("jump_pose");
    rigidbody.AddForce(Vector3.up * JumpSpeed, ForceMode.Impulse);
 }