Jquery search and query code similar to 51job

Source: Internet
Author: User

Jquery search and query code similar to 51job

Jquery search and query code similar to 51job

Var tmp_area_str = "";
Function chkQuickSearch (formname, hasincludearea, isarea ){
Var frm = eval ("document." + formname );
Var obj = frm. keyword;
Var isenglish;
Var cdefaultkeyword = 'Enter the keyword ';
Var edefakeykeyword = 'keyword ';
Var objValue = $. trim (obj. value );
If (window. location. href. indexOf ("/default-gj-e.php")> 0 ){
Isenglish = 1;
} Else {
Isenglish = 0;
}
If (hasincludearea = 1 ){
If (tmp_area_str = ""){
Tmp_area_str = frm. jobarea. value;
}
Frm. includearea. value = 0;
If (frm. includearea. checked ){
Frm. includearea. value = 1;
If (tmp_area_str = "0400 "){
Frm. jobarea. value = "0308,0400 ";
If (window. location. href. indexOf ("/default-area-e.php")> 0 ){
Frm. action = "http://search.111cn.cn/esc/search_result.php ";
} Else {
Frm. action = "http://search.111cn.cn/jobsearch/search_result.php ";
}
} Else {
Frm. jobarea. value = tmp_area_str.substr (0, 2) + "00 ";
}
} Else {
Frm. includearea. value = 0;
If (tmp_area_str = "0400 "){
If (window. location. href. indexOf ("/default-area-e.php")> 0 ){
Frm. action = "http://search.111cn.cn/esc/default_search.php ";
} Else {
Frm. action = "http://search.111cn.cn/jobsearch/default_search.php ";
}
}
Frm. jobarea. value = tmp_area_str;
}
}
If (isarea = 1 ){
If (frm. funtype. value = "") & (objValue = "" | objValue = cdefaultkeyword | objValue = edefakeykeyword )){
If (isenglish = 0 ){
Window. alert ("enter a keyword or select a function category. ");
} Else {
Window. alert ("Please enter keyword or select job function .");
}
// Frm. keyword. value = "";
// Frm. keyword. focus ();
Return false;
}
If (frm. issuedate. value = ""){
Frm. issuedate. value = 8;
}
If (objValue = cdefaultkeyword | objValue = edefakeykeyword ){
Obj. value = "";
}
Return true;
} Else {
If (frm. jobarea. value = ""){
If (isenglish = 0 ){
Window. alert ("the location must be selected and cannot be unlimited! ");
} Else {
Window. alert ("Please select Location! ");
}
Return false;
}
If (frm. funtype. value = "" & (objValue = "" | objValue = cdefaultkeyword | objValue = edefakeykeyword )){
If (isenglish = 0 ){
Window. alert ("enter a keyword or select a function category. ");
} Else {
Window. alert ("Please enter keyword or select job function .");
}
Return false;
}
If (frm. issuedate. value = ""){
Frm. issuedate. value = 8;
}
If (frm. jobarea. value = "0000" & frm. funtype. value = "" & (objValue = "" | objValue = cdefaultkeyword | objValue = edefaultkeyword )){
If (isenglish = 0 ){
Window. alert ("Enter the keyword! ");
} Else {
Window. alert ("Please input keyword! ");
}
Obj. value = "";
Obj. style. color = "";
Obj. focus ();
Return false;
} Else {
If (objValue = cdefaultkeyword | objValue = edefakeykeyword ){
Obj. value = "";
}
Return true;
}
}
}

Function chkKeywordSearch (formId, tipValue ){
Var obj = $ ("#" + formId) [0]. keyword;
Var cdefaultkeyword = 'Enter the keyword ';
Var edefakeykeyword = 'keyword ';
Var objValue = $. trim (obj. value );
If (objValue = "" | objValue = cdefaultkeyword | objValue = edefaultkeyword ){
Alert (tipValue );
Obj. value = "";
Obj. focus ();
Obj. style. color = "";
Return false;
}
Return true;
}


Function focusKeyword (obj, defaultKeyword ){
If (obj. value = defaultKeyword ){
Obj. value = "";
Obj. focus ();
}
Obj. style. color = "";
}

Function hotSearch (obj ){
Var keyword = pai.trim(((obj).html ());
Var formObj = $ ("# frmKeywordSearch") [0];
FormObj. keyword. value = keyword;
FormObj. fromType. value = 3;
FormObj. submit ();
}

Function switchSearchType (divId ){
If (divId = "searchform1 "){
$ ("# Searchform2"). hide ();
$ ("# Searchform1"). show ();
Var formObj = $ ("# frmKeywordSearch") [0];
FormObj. keyword. focus ();
FocusEnd (formObj. keyword );
} Else if (divId = "searchform2 "){
$ ("# Searchform1"). hide ();
$ ("# Searchform2"). show ();
Var formObj = $ ("# frmQuickSearch") [0];
FormObj. keyword. focus ();
FocusEnd (formObj. keyword );
}
}

 

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.