How to generate an SQL query form using JavaScript _ javascript tips-js tutorial

Source: Internet
Author: User
This article describes how to generate an SQL query form using JavaScript. It involves javascript page elements and string operations related skills and has some reference value, for more information about how to generate an SQL query form using JavaScript, see the following example. Share it with you for your reference. The details are as follows:

Here, JavaScript is used to generate a complex SQL Query Form. After you run it, you will understand that it can automatically modify your SQL statements based on the selected query conditions. This is a typical application.

The running effect is as follows:

The Code is as follows:

 Query condition formScript /// constructor function ce (e) {return document. createElement (e)}/* Example: * var a = cex ("DIV", {onmouseover: foo, name: 'p1', id: 'main '}); */function cex (e, x) {var a = ce (e); for (prop in x) {a [prop] = x [prop];} return ;} /** function ge * Shorthand function for document. getElementById (I) */function ge (I) {return document. getElementById (I)}/** function ac * Example: ac (house, ac (roof, shingles), ac (floor, ac (tiles, grout ))) */function ac () {if (ac. arguments. length> 1) {var a = ac. arguments [0]; for (I = 1; I = 150) document. all. conditionBox. style. height = h-20 + "px"; else return false;} function getSQL () {var SQL = ""; var ma = ge ("ConditionBox "). childNodes; for (I = 0; I
 
  
 
Complex Query Form

65

SQL expressions
Define conditions
Table Table 1 Table 2 Table 3 Table 4 Table 5 Field Field 1 Field 2 Field 3 Field 4 Field 5 Field 6 Field 7 Link Greater Equal Less Not equal Null Not empty Include Value

I hope this article will help you design javascript programs.

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.