To use jQuery you need to load jQuery into page if not already loaded.  Following code snippet shows loading of jQuery.

<?php
/*
Plugin Name: Test Jquery
Plugin URI: http://agilesolutionspk.com/training
Description: jquery test
Version: 1.0
Author: (put your name here)
*/

add_action( 'wp_enqueue_scripts', 'load_scripts' );

function load_scripts(){
	wp_enqueue_script('jquery');
	
}

add_shortcode('testjquery', 'shortcode_fnc');

function shortcode_fnc(){
	
	?>
		<form id="fm1"  name="whatever" method="POST" action="">
			<label>
				<input class="fm1" type="text" name="student_name" id="sname" />
				Please Enter Name
			</label>
			
			<label>
				<input type="text" name="gender"  id="gender" />
				Please enter gender (Male or Female or NTD )
			</label>
			
			<input id="submit" type="submit" name="testjquery" value="Test jQuery">
			
		</form>
		
		<script>
			jQuery(document).ready(function(){
			  jQuery("#fm1").submit(function(){
					var g = jQuery('#gender').val();
					if( g != "Male" && g != "Female" && g != "NTD"){
						alert('Please enter a valid value for Gender, value entered is ' + g);
					}
					return false;
			  });
			  return true;
			});
		</script>
	<?php
}