<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Vote_Add.aspx.cs" Inherits="TotCms.Web.Admin.Vote_Add" %>

<%@ Register src="UI/main_top.ascx" tagname="main_top" tagprefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>添加投票</title>
    <link href="style/global.css" rel="stylesheet" type="text/css" />
    <link href="js/calendar.css" rel="stylesheet" type="text/css" />
    <script src="js/common.js" type="text/javascript"></script>
    <script src="js/calendar.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
      <uc1:main_top ID="main_top1" runat="server" />
    
    </div>
    
    <table style="width:100%;" border="0" cellpadding="0" cellspacing="1" 
      class="black_border">
      <tr class="suphead">
        <td colspan="2">
                                                                                添加投票</td>
    </tr>
    <tr>
      <td class="fields_text">
        投票名称：</td>
      <td class="fields_input">
        <asp:TextBox ID="Title" runat="server" CssClass="input_middle"></asp:TextBox>
          <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
          ControlToValidate="Title" ErrorMessage="投票名称不能为空"></asp:RequiredFieldValidator>
          </td>
    </tr>
    <tr>
      <td class="fields_text">
        选项个数：</td>
      <td class="fields_input">
        <asp:TextBox ID="OptionNum" runat="server" CssClass="input_mini">4</asp:TextBox>
          </td>
    </tr>
    <tr>
      <td class="fields_text">
        类型：</td>
      <td class="fields_input">      
              
        <asp:RadioButtonList ID="OptionType" runat="server" 
          RepeatDirection="Horizontal" RepeatLayout="Flow">
          <asp:ListItem Value="0" Selected="True">单选</asp:ListItem>
          <asp:ListItem Value="1">复选</asp:ListItem>
        </asp:RadioButtonList>
          </td>
    </tr>
    <tr>
      <td class="fields_text">
        截止日期：</td>
      <td class="fields_input">      
              
        <asp:TextBox ID="ExpiresTime" runat="server"></asp:TextBox>
        <input name="button" type="button" onclick="displayCalendar(document.forms[0].ExpiresTime,'yyyy-mm-dd',this)" value="..." />
          </td>
    </tr>
    <tr>
      <td class="fields_text">
        投票选项：</td>
      <td class="fields_input">      
       <p align="left" id="Options">&nbsp;</p>	</td>
    </tr>
    <tr>
      <td colspan="2" align="center">
        <asp:Button ID="Button1" runat="server" Text="添加投票" onclick="Button1_Click" />
        <input id="Button2" type="reset" value="取 消" /></td>
    </tr>
  </table>
    </form>
<script type="text/javascript">
function ChooseOption()
 {
  var optionNum =parseInt(document.form1.OptionNum.value);
  var i,Optionstr;
	  Optionstr = '<table width="100%" border="0" cellspacing="2" cellpadding="4" align="left">';
  for (i=1;i<=optionNum;i++)
      {
	   Optionstr = Optionstr+'<tr><td width="10%"><div align="left">&nbsp;&nbsp;&nbsp;'+i+':</div></td><td><div align="left"><input type="text" size="20" name="Options'+i+'" value="">&nbsp;</div></td></tr>';
	   }
	Optionstr = Optionstr+'</table>';  	
    document.getElementById('Options').innerHTML = Optionstr;
  }
  ChooseOption();
</script>
</body>
</html>
