Php-js Determine whether the text box is empty, why my code can not judge, on the pointing
Source: Internet
Author: User
KeywordsPHP HTML Javascrpit
Phphtmljavascrpit
$conn = mysql_connect (' localhost ', ' root ', ' admin ') or die (' could not connect: '. Mysql_error ()); mysql_select_db (' sybgtjxt ') or die (' could not select database '); mysql_query ("Set names GBK");
?>
Lab Report Submission System
H2, font {font-style:oblique; color: #FCC898; font-weight:normal id=top; valign =top; position:relative;} function Yanzheng () {var cname = document.getElementById ("CNAME"). value; var tname = document.getElementById ("Tname"). Value var Ppro = document.getElementById ("Ppro"). Value; var pgrade = document.getElementById ("Pgrade"). Value; var pcol = document.getElementById ("Pcol"). Value; var pcutdate = document.getElementById ("Pcutdate"). Value; var pname = document.getElementById ("PName"). Value; var paim = Document.form1.paim.value; var pcontent = document.getElementById ("Pcontent"). Value; var pstep = document.getElementById ("Pstep"). Value; var Panalyse = document.getElementById ("Panalyse"). Value; var presult = document.getElementById ("Presult"). Value; This function does not implement if (cname== ") {Window.alert (" Please enter all contents "); return false;}} function Reset () {document.getElementById ("CNAME"). Value = ""; document.getElementById ("Tname"). Value = 0; document.getElementById ("Ppro"). Value = 0; Document.geteleMentbyid ("Pgrade"). Value = 0; document.getElementById ("Pcol"). Value = 0; document.getElementById ("Pcutdate"). Value = ""; document.getElementById ("PName"). Value = ""; document.getElementById ("Paim"). Value = ""; document.getElementById ("Pcontent"). Value = ""; document.getElementById ("Pstep"). Value = ""; document.getElementById ("Panalyse"). Value = ""; document.getElementById ("Presult"). Value = "";} function Yyyymmddstart () {monhead = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];///give under decade the contents of the frame var y = new Date (). getf Ullyear (); for (var i = (y-30); i < (y+30); i++)//Based on this year, first 30 years, 30 years after Document.form1.YYYY.options.add (new Option ("" + I, i)); Assigns the month drop-down box for (var i = 1; i < i++) {if (i>=1&&i<10) Document.form1.MM.options.add (New Option ("" + "0" + I, i)); else{Document.form1.MM.options.add (New Option ("" +i, I));}} Document.form1.YYYY.value = y; Document.form1.MM.value = new Date (). GetMonth () + 1; var n = monhead[new Date (). GetMonth ()]; if (new Date (). GetMonth () ==1 &&Amp Ispinyear (Yyyyvalue)) n++; Writeday (n); Assignment Date drop-down box Document.form1.DD.value = new Date (). GetDate (); } if (document.attachevent) window.attachevent ("onload", Yyyymmddstart); else Window.addeventlistener (' Load ', Yyyymmddstart, false); function Yyyydd (str)//year changes in date (mainly judging leap common year) {var mmvalue = document.form1.mm.options[ Document.form1.mm.selectedindex].value; if (Mmvalue = = "") {var e = Document.form1.DD; Optionsclear (e); return;} var n = monhead[mmvalue-1]; if (Mmvalue ==2 && ispinyear (str)) n++; Writeday (N)} function MMDD (str)//month changed date linkage {var yyyyvalue = document.form1.yyyy.options[ Document.form1.yyyy.selectedindex].value; if (Yyyyvalue = = "") {var e = Document.form1.DD; Optionsclear (e); return;} var n = monhead[str-1]; if (str ==2 && ispinyear (yyyyvalue)) n++; Writeday (N)} function Writeday (n)//The drop-down box of the conditional write date {var e = Document.form1.DD; Optionsclear (e); for (var I=1; i< (n+1); i+ +) E.options.add (new Option ("" + I, I));} function Ispinyear (year)//Determine if leap common year {RETurn (0 = = year%4 && (year%100!=0 | | year%400 = 0)); } function Optionsclear (e) {e.options.length = 1;}
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.