|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Search engine posting to a form
I don' know if this is possible but hear it goes. The following is a support client that I am trying to create. What I want to do is have the search by id field find a ticket by the ticket ID and then post the information into to the form. The user will then be able to edit the existing ticket if he/she needs to or just look at an issue that is he/she is currently working on.
Is it possible to post data into a textbox? The search engine part shouldn't be to hard to create it's just getting the ticket info to post into the form on the same page that I don't know how to do. The tables look like this tContact contactid firstname lastname tTicket ticketID contactID urgency description probdescription probresolution The support client. Thanks Sparky <% Option Explicit ' Let's populate a dropdown with the User Names from ' UserInfo table where UserID 3 should be selected ' in the dropdown Dim SelectedUserID SelecteduserID = 4 ' We will make a call to Sub Routine PopulateDropDown ' which will select all users from UserInfo table and ' populate a dropdown. This sub routine will also check ' for selected user and marked as SELECTED Call PopulateDropDown( SelectedUserID ) ' ********************************* ' Populate Drop Down Sub Routine ' ********************************* Sub PopulateDropDown(byVal SelectedUserID) Dim objConn Dim objRS Dim strSQL Dim contactID Dim firstname Const adOpenForwardOnly = 0 Const adLockReadOnly = 1 Set objConn = Server.CreateObject("ADODB.Connection") Set objRS = Server.CreateObject("ADODB.Recordset") objConn.Open "Provider=SQLOLEDB; Data Source=SPARKDLE-LPSJXL; Initial Catalog=LogIN; User Id=sa; Password=sa" strSQL = "SELECT contactID, firstname FROM tContact" objRS.Open strSQL, objConn, adOpenForwardOnly, adLockReadOnly %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>:::SPARKDELICIOUS SUPPORT::: </TITLE> <META NAME="Generator" CONTENT="EditPlus"> <META NAME="Author" CONTENT=""> <META NAME="Keywords" CONTENT=""> <META NAME="Description" CONTENT=""> </HEAD> <BODY> <TABLE border=1 width=100% height=100%> <tr> <TD height=> <table width =90% height=95% border=1 align=center> <br> <tr align=middle> <td valign=middle> <TABLE width=100% border=1> <TR> <TD width=15%>SEARCH BY ID</TD> <td><INPUT TYPE="text" NAME="userID"><INPUT TYPE="submit" name="Submit"></td> <td>SEARCH BY SUBJECT <td align=right><INPUT TYPE="text" NAME="userID"><INPUT TYPE="submit" name="Submit"></td> <TR> <TD width=15%>SEARCH BY CONTACT</TD> <td align=left><INPUT TYPE="text" NAME="userID"><INPUT TYPE="submit" name="Submit"></td> <td> </td> <td align=right><INPUT TYPE="submit" name="NEW" value="New Ticket"></td> <form name="Search" method="Post" action="addticket.asp"> <TABLE width=100% border=1> <TR> <TD width=15%>TICKET ID</TD> <TD><INPUT TYPE="text" NAME="ticketID" ></TD> </TR> <TR> <% Response.Write "<TD width=""15%"">CONTACT</td>" Response.Write "<TD><SELECT Name=""firstname"">" Response.Write "<OPTION Value=""""></OPTION>" ' Loop through the recordset and populate the dropdown Do Until objRS.EOF = True contactID = objRS("contactID").Value firstname = objRS("firstname").Value If contactID = SelectedUserID Then Response.Write "<OPTION Value=""" & contactid & """ SELECTED>" Response.Write firstname Response.Write "</OPTION>" Else Response.Write "<OPTION Value=""" & contactid & """>" Response.Write firstname Response.Write "</OPTION>" End If objRS.Movenext Loop Response.Write "</SELECT>" objRS.Close Set objRS = Nothing Set objConn = Nothing End Sub %> <form> <TD width=70% valign=top><INPUT type="button" value="New Contact" onClick="window.open('add_contact.asp','mywindow','width=400,height=200,left=350,top=200,screenX=350,screenY= 200,')"> </form> </TR> <TR> <TD width=15%>VERSION</TD> <TD><SELECT NAME="a-menu"> <OPTION> 4.0 <OPTION> 5.2 <OPTION> 6.0 </SELECT> </TD> </TR> <TR> <TD width=15%>URGENCY</TD> <TD><SELECT NAME="urgency"> <OPTION>Low <OPTION>Meduim <OPTION>High</TD> <TR> <TD width=15%>ASSIGNED TO</TD> <TD><INPUT TYPE="text" NAME="userID"> <TR> <TD width=15%>COMPLETED BY</TD> <TD><INPUT TYPE="text" NAME="userID"></td></td> <TABLE width=100% height=50% border=1> <TR> <TD height=25 colspan=2> <table width=100% height=10% border=1> <TR> <TD width=15%>SUBJECT</TD> <TD><INPUT TYPE="text" NAME="description" SIZE=113></TD> </TR> <table width=100% height=100% border=1> <tr> <td height=25>PROBLEM DESCRIPTION <td>PROBLEM RESOLUTION <TR> <INPUT TYPE="submit"> <TD width=50% valign=top><TEXTAREA NAME="probdescription" ROWS="8" COLS="48"></TEXTAREA></TD> <TD width=50% valign=top><TEXTAREA NAME="probresolution" ROWS="8" COLS="48"> </TEXTAREA></TD> <tr> </TABLE> </BODY> </HTML> |
|
#2
|
|||
|
|||
|
You use the value property for your textbox
i.e. Code:
<input type="textbox" name="ticket" value="<%=Request.Form("ticket")%>"
This defaults the text displayed in the textbox to the form value. You may need to work this around a bit, but I hope gives you the general idea.
__________________
How can I soar like an eagle when I'm flying with turkey's? |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Search engine posting to a form |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|