Jygl system learning 1

Source: Internet
Author: User

 

1. The vertical line in the frame (a self-made graph) can be left and right to change the frame. Attachment: splitor Project

Splitor.html
<HTML>
<Head>
<Title> </title>
<Link href = "CSS/public.css" rel = "stylesheet" type = "text/CSS"/>
<SCRIPT type = "text/JavaScript">
Function showhide (titl ){
If (titl = "Left "){
Document. All. img1.src = "images/rightmove.gif ";
Top.doc ument. getelementbyid ("Middle"). Cols = ", *"; // enables the upper-level page, that is, the column entries of the frame page are aligned to the rightmost
Document. All. img1.title = "right ";
} Else {
Document. All. img1.src = "images/leftmove.gif ";
Top.doc ument. getelementbyid ("Middle "). cols = ", *"; // enables the upper-level page, that is, the column entries on the frame page are aligned to the leftmost, which is also the initial form.
Document. All. img1.title = "Left ";
}
}
</SCRIPT>
</Head>
<Body leftmargin = "0" topmargin = "0">
<Table Style = "cursor: hand "width =" 100% "Height =" 100% "background =" images/splitor7.gif "border =" 0 "cellspacing =" 0 "cellpadding =" 0 ">
<Tr>
<TD align = "center" valign = "Middle"> </TD>
</Tr>
</Table>
</Body>

 

2. Text Box Verification:

Check. js (defined attribute rules allownull, isdigital, isint, allowzero, isdate, and usage)
// Check. js starts
// Usage: Call return checkownrule (objfrm) in the form submission event );
// The input parameter is the current form object. The premise of using this function is that the page must contain check. js
Function checkownrule (objfrm ){

// Verify the input
VaR inputobj = objfrm. getelementsbytagname ("input ");

For (I = 0; I <inputobj. length; I ++ ){
If (! Inputobj (I). getattribute ("hint") | inputobj (I). getattribute ("hint") = "")
{
Strhint = inputobj (I). Name;
} Else {
Strhint = inputobj (I). getattribute ("hint ");
}

// Do not leave it blank
// For example: <input type = "text" name = "username" allownull = "false" hint = "username">
If (inputobj (I). getattribute ("allownull") = "false "){


If (inputobj (I). value = ""){
Alert (strhint + "cannot be blank! ");
Return false;
}
}

// Only a number is allowed
// For example: <input type = "text" name = "username" isdigital = "true" hint = "username">
If (inputobj (I). getattribute ("isdigital") = "true "){
If (inputobj (I). value! = "" & Isnan (inputobj (I). Value )){
Alert (strhint + "must be a number! ");
Inputobj (I). Focus ();
Return false;
}
}

// Only an integer is allowed.
// For example: <input type = "text" name = "username" isint = "true" hint = "username">
If (inputobj (I). getattribute ("isint") = "true "){
If (inputobj (I). value. indexof (".")> = 0 ){
Alert (strhint + "must be an integer! ");
Inputobj (I). Focus ();
Return false;
}
}

// Do not enter 0
// For example: <input type = "text" name = "username" allowzero = "false" hint = "username">
If (inputobj (I). getattribute ("allowzero") = "false "){
If (inputobj (I). value = 0 ){
Alert (strhint + "cannot be 0! ");
Inputobj (I). Focus ();
Return false;
}
}

// Date only
// For example, <input type = "text" name = "username" isdate = "true" hint = "date">
If (inputobj (I). getattribute ("isdate") = "true "){
If (inputobj (I). value! = ""&&! Checkdate (inputobj (I). Value )){
Alert (strhint + "must be in the correct date format! ");
Inputobj (I). Focus ();
Return false;
}
}

}

// Verify select
VaR selectobj = objfrm. getelementsbytagname ("select ");
For (I = 0; I <selectobj. length; I ++ ){
If (! Selectobj (I). getattribute ("hint") | selectobj (I). getattribute ("hint") = "")
{
Strhint = selectobj (I). Name;
} Else {
Strhint = selectobj (I). getattribute ("hint ");
}

// Cannot be blank
// For example: <select name = "XXX" allownull = "false" hint = "drop-down list">
If (selectobj (I). getattribute ("allownull") = "false "){
If (selectobj (I). value = ""){
Alert (strhint + "cannot be blank! ");
Selectobj (I). Focus ();
Return false;
}
}

}

// Verify textarea
VaR areaobj = objfrm. getelementsbytagname ("textarea ");
For (I = 0; I <areaobj. length; I ++ ){
If (! Areaobj (I). getattribute ("hint") | areaobj (I). getattribute ("hint") = "")
{
Strhint = areaobj (I). Name;
} Else {
Strhint = areaobj (I). getattribute ("hint ");
}

// Cannot be blank
// Example: <textarea name = "zysm" allownull = "false" hint = "professional description">
If (areaobj (I). getattribute ("allownull") = "false "){
If (areaobj (I). value = ""){
Alert (strhint + "cannot be blank! ");
Areaobj (I). Focus ();
Return false;
}
}

}

Return true;
}

// This function is a function that checks whether it is a date. The above method is called.
Function checkdate (STR ){
VaR Reg =/^ (/d +)-(/d {1, 2})-(/d {1, 2}) $ /;
VaR r = Str. Match (REG );
If (r = NULL) return false;
R [2] = R [2]-1;
VaR d = new date (R [1], R [2], R [3]);
If (D. getfullyear ()! = R [1]) return false;
If (D. getmonth ()! = R [2]) return false;
If (D. getdate ()! = R [3]) return false;

Return true;
}

// Check. js ended

 

Extended usage
The verification submission function is:
Function tijiao (objform ){
If (checkownrule (objform) {// you can use the above verification function (true if all of them are satisfied). The following is the extension part.
VaR Bz = Document. All. ZP. value;
If (BZ! = ""){
Reg = //. ([^/.] +) $ /;
VaR e=reg.exe C (BZ) [1]. tolowercase ();
If (E! = "Jpg" & E! = "BMP" & E! = "GIF "){
Alert ("image format files must be uploaded! ");
Return false;
}
}
Return true;

} Else {
Return false;
}

}

3. Use SQL to query in eclipse
Connection: Open the DB browser in the perspective, edit the database to be connected, and connect to the database.
Test: Write A *. SQL script, select the statement to be executed, and click the statement key.
SQL result

4. Import jar
Copying to lib
Sometimes another method is required: click Project/build path/Add Library/user Library/create/Add jar

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.