473,651 Members | 3,011 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to make a user suggestion form

145 New Member
I have a form where user will insert any suggestion that they may have.

I want to know how to make each suggestion appear according to the newest to oldest where the newest is on top and oldest below on the same page. As user click submit button it will appear on the page. It is the same way this site operate when there user post question and other reply, then the it wil display on the same page according to date.

How can i do this? Does it involve javascript?

Im thinking of using iframe in my html/css. Can it work?
May 21 '10 #1
8 2232
ThatThatGuy
449 Recognized Expert Contributor
Are you trying to say. that you want to build something like google suggest
May 21 '10 #2
puT3
145 New Member
sorry i dont know google suggest..but what im want to do is like this site where when user post a reply, the reply will show on the page..
May 24 '10 #3
puT3
145 New Member
@puT3
My code is like below:

Expand|Select|Wrap|Line Numbers
  1. <%
  2.   Response.Write(Request.Form("txtNama"))
  3.   Response.Write(Request.Form("txtEmail"))
  4.   Response.Write(Request.Form("txtCadangan"))
  5. %>
  6.  
  7. <div id="colTwo">
  8.        <h2>Cadangan Anda</h2>
  9.        <p>Sila isikan cadangan anda.</p>
  10.  
  11.         <form name='cadangan' action='c2.asp' method="post">
  12.         <table>    
  13.  
  14.             <tr><td><p>Nama:</p></td>
  15.                 <td><input type='text' name='txtNama' size='40'/></p></td>
  16.             </tr>  
  17.  
  18.             <tr><td><p>Email:</p></td>
  19.                 <td><input type='text' name='txtEmail' size='40'/></p></td>
  20.             </tr>   
  21.  
  22.             <tr><td><p>Cadangan:</p></td>
  23.                 <td><textarea rows="10" cols="31"             name="txtCadangan"></textarea></p></td>
  24.             </tr>
  25.  
  26.             <tr><td><p></p></td>
  27.                 <td><p></p></td>
  28.             </tr>
  29.  
  30.             <tr><td><p></p></td>
  31.                 <td><p></p></td>
  32.             </tr>
  33.             <tr><td>&nbsp;</td>
  34.                 <td align="center"><input type="submit" value="Hantar" />
  35.                     <input type="reset" value="Batal" /></td>
  36.             </tr>
  37.  
  38.         </table>
  39.         </form>
  40. </div>
  41.  
  42.  
From this code, how can i make sure the earlier suggestion still on the page and it is not being replaced if there is a new suggestion is submit.
May 24 '10 #4
ThatThatGuy
449 Recognized Expert Contributor
@puT3
Ok, i got it.
You need to store the suggestion entered by the user in the database.
While, the table in which you'll be storing the data will also contain an autonumber or identity column.

So whenever you addany data to the database it will automatically generate the autonumber for the record.

And by the getting the list of data by order by descending inside the select query you can get the most updated data... in descending order
May 24 '10 #5
puT3
145 New Member
@ThatThatGuy
ok thanks...

I alread tried but when i click submit the data entered does not appear in the table.

My database:

Table name: Cadangan
Expand|Select|Wrap|Line Numbers
  1. ID (Autonumber) PK
  2. Nama
  3. Email
  4. Cadangan
  5.  
While the code in my asp file as below:

Expand|Select|Wrap|Line Numbers
  1. <%
  2.  
  3.         var DSN ="C:/Inetpub/wwwroot/TM/Telekom.mdb"
  4.         var Conn = Server.CreateObject("ADODB.Connection");
  5.         Conn.Provider = "Microsoft.Jet.OLEDB.4.0"
  6.         Conn.Open(DSN);
  7.  
  8.         if(Request("Hantar") == "SUBMIT")
  9.         {
  10.  
  11.             var frmNama=Request.Form("txtNama")
  12.             var frmEmail=Request.Form("txtEmail")
  13.             var frmCadangan=Request.Form("txtCadangan")
  14.  
  15.             sql2="INSERT INTO Cadangan(Nama,Email,Cadangan) VALUES ('"+ frmNama+"','"+frmEmail+"','"+frmCadangan+"')";
  16.  
  17.             Conn.Execute(sql2);
  18.             Conn.Close()
  19.             Conn = null
  20.         }
  21.  
  22.             sql ="SELECT * FROM Cadangan"
  23.  
  24.             rs = Server.CreateObject("ADODB.Recordset");
  25.             rs.Open(sql,Conn);
  26.  
  27.             out = "<table>"
  28.             while (!(rs.EOF))
  29.             {
  30.                 out += "<tr><td>" + rs("Nama") + "</td><td>" + rs("Email") + "</td></tr>"
  31.                 out += "<tr><td>" + rs("Cadangan") + "</td><td></td></tr>"
  32.  
  33.                 rs.Movenext();
  34.             }        
  35.             out += "</table>"
  36.  
  37.             rs.Close()
  38.             rs = null
  39.             Conn.Close()
  40.             Conn = null
  41.  
  42.             Response.Write(out);
  43.  
  44.  
  45. %>
  46.  
My form:
Expand|Select|Wrap|Line Numbers
  1. Nama:<input type="text' name="txtNama">
  2. E-mail:<input type="text" name="txtEmail>
  3. Alamat:<textarea></textarea>
  4.  
Is there any error it in? because I cannot see it. Please look and correct it if any.
May 24 '10 #6
ThatThatGuy
449 Recognized Expert Contributor
@puT3
It won't happen automatically ...
I suggest you should have a gridview or a FormView kind of a control
which will show the posts as per to the most recent one..
update the gridView from database on every postback or when the data is submitted to the database..

or you can do it manually if you want to do this via HTML
May 24 '10 #7
puT3
145 New Member
hi,
what do you mean by gridview or formview?i dont understand...an d if by html how to do it?

does it mean my code above cannot be used?
May 24 '10 #8
puT3
145 New Member
Thats ok..Forget about...Thamks
May 25 '10 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

4
6354
by: harrylmh | last post by:
Hi, I've really been struggling with this. How do I make a form resizable with FormBorderStyle = None? I've had problems trying to get the form to start resizing by following the mouse position(after the mouse is at the edge of the form and starts to move out of the form with the mouse button down) Any ideas anybody? There's got to be an easier and more effective way right?
10
1338
by: Ioannis Vranos | last post by:
Is there any way to make a form *not closing* when its X on the upper-right is clicked? Is there any event for handling clicks on the X (e.g. to perform additional actions)?
4
2295
by: Sumit | last post by:
Can any one Please tell me how to write a code to make a form that has only one instance. Like in Visual Basic 6.0
0
1438
by: Ricky Kam | last post by:
Hello, In my program, I'm opening a windows form(name it "s") from the main form(name it main). When form "s" load, it is movable even when it's maximized, which I don't want. Also, when the form is maximised, the size is such that it will coverup the windows bar. Kinda werid since when the main form is maximized, these problem don't exists. Anyone got an idea how to fix up the two problems? Thankz, Ricky
0
833
by: Jerry Spence1 | last post by:
In VB6, I was able to step through the code and whenever I came to a part that added a control, or added text to a textbox etc, I was able to task switch and see the form so's I could see that everything was happening OK. In VB.Net the form is just a blank white colour when debugging. Can I do anything to make it behave as VB6? - Jerry
2
4154
by: Srin | last post by:
Hi, I've been trying to write a small windows application in C#. I want the form to read special input sequences act accordingly. For example, <Alt><Ctrl>H should bring up the help box etc. I tried to use the form1_keydown event, but that doesn't seem to work. What can be done to make it work? Thanks in advance.
1
1418
by: monicarana | last post by:
Hi All, I have a form with a field "ID" and a View Button. I am calling another form on the press of a view button, the called form should display the data corresponding to the ID field in the first form. I want the second form to be readonly. I am using the below code Private Sub cmdView_Click() strLinkCriteria = " = Forms!!!" DoCmd.OpenForm "Form2", , , strLinkCriteria DoCmd.MoveSize (1440 * 0.1), (1440 * 0.1) ...
1
1181
by: rayazax | last post by:
Hello, I need to make my form to act like a task bar. I mean, I want my form to be top over all other forms, and to be task bar. I mean all other forms must be above it. I am trying to use SetWindowsPos function, it makes my form top, but all other apps is behind it. Thanks
3
1209
by: seangibson | last post by:
I have a form for entering data into a table. I would like the form to be blank when I open it, but it is showing the data contained in the first record of the table. Is there any way to set the properties so that it defaults to an "input new record" mode? In other words, I don't want it to display the data for the first record when I open the form... Thanks for any help.
6
2358
by: 85ssp | last post by:
I have a server applicatoin that has a multitude of labels related to the clients connected to it. When I have a number near 50 clients and i recieve a updatated status from each of the clients at once the labels are updated to the current status. (basically a label color is changed depending on status), this operation causes the mainform to freeze until it can process all of the messages recieved. I have tried everything possible to make...
0
8361
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8807
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8701
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8466
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7299
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6158
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4144
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2701
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1912
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.