Tuesday 12 March 2013

Nested Form


<html>
  <title></title>
  <head>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript">
  $(function(){
     $('#idFirstBtn').click(function(){
    /*if($('#idSnum').val()==""){
  alert('required');
  return false;
}*/
window.location.replace("https://www.google.co.in/");
 });
 $('#idSecondBtn').click(function(){
    /*if($('#thirdTxt').val()==""){
  alert('also required');
  return false;                                                                
}*/
window.location.replace("http://www.w3schools.com/jquery/event_submit.asp");
 });
  });
</script>
  </head>
  <body>
<form name="form1" target="" action="" method="get" id="form1" action="">
   <form target="" name="form2" action="" method="get">
street number:<input type="text" name="q" value="" id="thirdTxt"/>
<input type="button" value="SecondBtn" id="idSecondBtn"/>
</form>
street name:<input type="text" name="snam" value=""/>
<input type="button" value="FirstBtn" id="idFirstBtn"/>
</form>
  </body>
</html>

No comments:

Post a Comment