form action with button calendar

A

Anonymous

Guest
Hello Everybody.


I',m Using
Code:
 <form action=sample.php method=post>
to navigate sample.php.and buttons as calendar.if i click calendar button a new window with calendar should open.

Conditions are like this
if i comment Form line code. Calendar is going to display.and which stop me to navigate to sample.php.
if i use Form code.Calendar will wont display.only a new window with plain screen is displayed.

ineed both action to be performed.Suggestions are appreciated.

TIA
Regards
salam
 
Well, if your calendar button is inside the form... it is a form element!
Use type="button" and onclick() to call the window open function!

You better show us your form code if possible!

Cheers
 
This is my code

Code:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

 <script language="javascript">

function window_open()
{
var newWindow;
var urlstring = 'Calendar.php'
newWindow = window.open(urlstring,'','height=200,width=280,toolbar=no,minimize=no,status=no,memubar=no,location=no,scrollbars=no')
}

  function window_open1()
{
var newWindow;
var urlstring = 'Calendar1.php'
newWindow = window.open(urlstring,'','height=200,width=280,toolbar=no,minimize=no,status=no,memubar=no,location=no,scrollbars=no')
}


</script>
</head>
 <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><CENTER>
 <form action=sample.php method=post>
 <form name= "txtDate2" action="reports.php" method="post">-->
<table width="544" border="0" cellpadding="0" cellspacing="0">
                                                              41,0-1 
<tr>
  <td width="27" rowspan="6" valign="top"> </td>
<td height="23" colspan="3" valign="middle"><p align="center"><font size="6" face="Verdana, Arial, Helvetica, sans-serif"><strong>SugarCRM Reports Generation</strong></font></p><br></td>

  <td height="23" colspan="2" valign="top"> </td>
</tr>
<td
 height="30" valign="middle"><div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><b>From Date
    :</b>   </font></div></td>
 <td width="380" valign="middle"><input type=text  name='txtDate' >
      <input name="button" type=button onClick="window_open()" value='Calendar'>     </td>
  </tr>
  <tr>
    <td height="30" valign="middle"><div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><b>To Date
    :</b>   </font></div></td>
    <td valign="middle"><input type=text  name='txtDate2'>
      <input name="button2" type=button onClick="window_open1()" value='Calendar'>
</td>
  </tr>
 <tr>
<td height="74" valign="top"> </td>
    <td colspan="2" valign="middle">
      <div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> </font>              <input type="submit" name="Submit" value="Generate">

 </div>
</td>
  </tr>
</table>
 </form>
</center>
</body>
</html>
 
First, you better fix some little errors along your code... like:
Code:
<input name="button2" type=button onClick="window_open1()" value='Calendar'>
Right way:
Code:
<input name="button2" type="button" onclick="window_open1()" value="Calendar">
Be careful with this too :p
Code:
 <form action=sample.php method=post>
 <form name= "txtDate2" action="reports.php" method="post">-->
 
thankx for ur suggestion ihave make corretion in that. but still i'm not getting the calendar
 
yeah! i have commented tht code.it wont affect my result.but how enable calendar button.
 
Back
Top