I just learned JavaScript and hope you can help me!
This is the code selected by project participants in a management system. The problem to be solved is:
1. After you click "select person", a new window is displayed. You can search for a person by name or organization, select the person you want to select, and continue searching for the next person. Then, select.
2. After selecting the person to be selected, return the value to the personnel form on the home page.
3. You can enter multiple fields in a form.
For example, to add a project information
There are
Project host
Project Team
Personnel information is obtained from the personnel information library.
The following is the code on the homepage. The value cannot be passed because ifrma is used.
Package the file:
Http://www.HNTF.CN/RYXZ.rar
</Head> <style type = "text/css"> </style> <body> <table width = "100%" border = "0" cellspacing = "0" cellpadding = "0"> <tr> <td> <table width = "100%" border = "0" cellpadding = "0" cellspacing = "0"> <tr> <td> <table width = "100%" border = "0" cellpadding = "0" cellspacing = "0" class = "titlebar"> <tr> <td> select a person </td> </tr> </table> <table width = "98%" border = "0" align = "center" cellpadding = "6" cellspacing = "0"> <tr> <td height = "34"> <input name = "button3" type = "button" class = "header_btn" onClick = "javascript: list_sub1 (); "value =" Continue submission "> <input name =" button4 "type =" button "class =" header_btn "onClick =" javascript: list_sub (); "value =" selected "> <input name =" button5 "type =" button "class =" header_btn "onClick =" javascript: list_sub2 (); "value =" empty "> <input name =" button "type =" button "class =" header_btn "onClick =" javascript: shout (); "value =" "> </td> </tr> </table> </td> </tr> </table> </body> </ptml>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
Temporary solution implemented with ajax
I have found a better method. The basic idea is to implement JS + Ajax.
I personally think this method solves the problem of multiple searches, and it is better to pass values multiple times. The js Code selected in it is copied without worry. If there is a better method, I hope you can give me some advice! This problem is often encountered during data entry in the office system, and vbs is very difficult to solve.
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ptml xmlns = "http://www.w3.org/1999/xhtml"> <pead> <meta http-equiv =" content-Type "content =" text/html; charset = UTF-8 "/> <title> untitled document </title> <style type =" text/css "> </style> </pead> <body> <input name = "searchword" type = "text" class = "input" id = "searchword" onChange = "AjaxSearch (); "onKeyDown =" if (event. keyCode = 13) AjaxSearch (); "/> <input type =" button "class =" header_btn "onClick =" AjaxSearch (); "value =" Search "/> <ul> <li> enter a keyword </li> </ul> </body> </ptml>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]
Ajaxsearch. asp
<% 'Dbdb2.asp is the database connection file Dim Search_Word, XML_Result, rsSearch, sqlSearch Set rsSearch = Server. createObject ("ADODB. recordSet ") 'obtain the search keyword Search_Word = Trim (Request (" searchword ")' XML Document Header XML_Result =" <? Xml version = "" 1.0 "" encoding = "" gb2312 ""?> <Blogsearch> "IF Search_Word <> Empty then' create a query SQL statement sqlSearch =" SELECT * FROM wuhen_t_yg WHERE ygxm LIKE '% "& Search_Word &" % 'order BY ygbh DESC "' open the record set rsSearch. open sqlSearch, Conn, 'generates a result IF no search result is found. The logid is #, indicating that no search result IF rsSearch is found. bof and rsSearch. EOF Then XML_Result = XML_Result & "<result> <logid >#</logid> <logtitle/> </result>" 'output the search result cyclically Do While Not rsSearch. EOF XML_Result = XML_Result & "<result> <lo Gid> "& rsSearch (" ygbh ") &" </logid> <logtitle> <! [CDATA ["& rsSearch (" ygxm ") &"]> </logtitle> <logtitle2> <! [CDATA ["& rsSearch (" dw ") &"]> </logtitle2> </result> "'cyclically outputs each result rsSearch. the MoveNext Loop Else keyword is null, IF no search result is returned, XML_Result = XML_Result & "<result> <logid >#</logid> <logtitle/> </result>" End IF XML_Result = XML_Result & "</blogsearch> "'set MIME Type to XML document Response. contentType = "application/xml" 'response. charSet = "UTF-8" 'output the search result Response. write (XML_Result) %>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]