Using JQuery to simulate Button Click

Using JQuery to simulate Button Click

I have some jQuery that is being run when the use clicks return.  Basically I have an input box and a button.  After the user adds some search criteria in the input box they can click return and start the search

  1. $("#searchvalue").keyup(function(event){
  2. if(event.keyCode == 13){
  3. if( !$('#searchvalue').val() ) {
  4. alert("Please Enter a Search Value");
  5. }
  6. else{
  7. window.location.href = "/search.php?ItemValue=" + $("#searchvalue").val();
  8. }
  9. }
  10. });


  1. <span id="SpanDepartment"><input id="searchvalue" type="text" name="Search" value="" placeholder="Search Value"/> </span>
  2. <span id="SpanDepartment"><a href="javascript:;" tabindex="-1"><img src="images/Search.gif" align="center" border="0" id="searchbuttonclick" Class="searchbutton"></a></span>


I now have a similar deal but unsure how to handle it... I have a User Name and Password that I want to do this with..after the password I want then to be able to click return and do the same.
BUT I AM NOT GOING TO A PAGE and passing a variable.
I AM doing a submit...

  1. $("#startlogin").keyup(function(event){
  2. if(event.keyCode == 13){
  3. if( !$('#startlogin').val() ) {
  4. alert("Please Enter a Search Value");
  5. }
  6. else{
  7.                        /*  THERE SHOULD BE A SUBMIT HERE*/
  8. }
  9. }
  10. });

  1. <form action="" method="post">
  2. <p>
  3. Email: <input type="email" name="login_email" required autofocus/> 
  4. Password: <input type="password" id="startlogin" name="login_password" /> 
  5. <input type="submit" value="Log in" />
  6. </p>
  7. </form>


Any help would be greatly appreciated.  Thanks for viewing this