User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 374,007 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,917 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 1233 | Replies: 6
Reply
Join Date: Feb 2008
Posts: 26
Reputation: brr is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
brr brr is offline Offline
Light Poster

Confirmation message

  #1  
Mar 3rd, 2008
in my form after filling all details
click on the submit button
after inserting the data iam getting the same page with empty fields, till this ok

i want to display in that form one confirmation message along with empty fields like
Date inserted successfully
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 6,731
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 23
Solved Threads: 323
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Rebellion Revamped

Re: Confirmation message

  #2  
Mar 3rd, 2008
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
            "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="Expires" content="0" /> <!-- disable caching -->
    <title>Ajax Example</title>
    <script type="text/javascript">
      function check(frm) {
        var dataIsValid = true;
        /* all your validation/processing code goes here */
        if(dataIsValid) {
          alert("Form successfully submitted!");
          return(true);
        } else {
          return(false);
        }
      }
    </script>
</head>
<body>
   <form id="frm" action="#" onsubmit="return check(this);">
    <label for="txtName">Name:</label>
    <input name="txtName" id="txtName">
    <br>
    <input type="submit" value="Submit form">
   </form>
</body>
</html>
"I don't accept change. I don't deserve to live."

"Working a real job is a win if you're lazy, greedy, or unmotivated. If you're average, you fit right in. And if you're above average, the basic terms of employment and premise of the arrangement is against your interests."
Reply With Quote  
Join Date: Feb 2008
Posts: 5
Reputation: zabindia is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
zabindia zabindia is offline Offline
Newbie Poster

Re: Confirmation message

  #3  
Mar 4th, 2008
Check this code...u can use innerHTML instead of "Alert box"

  1. <html>
  2. <head>
  3. <style>
  4. .message
  5. {font-family:Arial, ;font-size:15px;color:#FF0000;
  6. }
  7. </style>
  8. <script>
  9. function validate(frm) {
  10. var dataIsValid = true;
  11. var showmsg= document.getElementById("showMesage");
  12.  
  13. /* your validation codes goes here */
  14. if(dataIsValid) {
  15. showmsg.style.visibility = 'visible' ;
  16. showmsg.style.display ='';
  17. showmsg.innerHTML="Thank you";
  18.  
  19. return(true);
  20. } else {
  21. return(false);
  22. }
  23. }
  24. </script>
  25.  
  26. </head>
  27. <body>
  28. <form id="frm" action="#" onsubmit="return validate(this);">
  29. <table><tr>
  30. <td> Name:</td>
  31. <td> <input name="txtName" id="txtName"></td></tr>
  32.  
  33. <tr><td colspan="2">
  34. <input type="submit" value="Submit form"></td>
  35. </tr>
  36.  
  37. <tr><td id="showMesage" class="message' style="visibility:hidden;display:none"> &nbsp;</td>
  38. </table>
  39.  
  40. </form>
  41. </body>
  42. </html>
Last edited by peter_budo : Mar 6th, 2008 at 5:22 am. Reason: code= html not code = language ;D
Reply With Quote  
Join Date: Feb 2008
Posts: 26
Reputation: brr is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
brr brr is offline Offline
Light Poster

Re: Confirmation message

  #4  
Mar 5th, 2008
Thanqs for ur reply
but i want like in gmail after compose mail we click on send button
then we get inbox screen on that page we will get one msg that is ur message has been sent successfully
like that i want
even js,ajax also ok

in my form(already iam using ajax in jsp) after enter data i click on submit button
it calls another jsp in that data is insert in databse after that without any click it goes to another jsp page on that page i want msg insert successfully
Reply With Quote  
Join Date: Jan 2008
Location: Bangalore, India
Posts: 327
Reputation: DangerDev is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 31
DangerDev's Avatar
DangerDev DangerDev is offline Offline
Posting Whiz

Re: Confirmation message

  #5  
Mar 5th, 2008
hi
use one variable isInserted, which will be set true if data is inserted successfully, check its value inside the page and based on this insert a div element which will show the required message.

are u using ajax for submission ?

if ~s.o.s~ code is ok for you, you can insert div element instead of showing alert message in if statement.
Last edited by DangerDev : Mar 5th, 2008 at 12:30 am.
A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila.
~Mitch Ratcliffe
Reply With Quote  
Join Date: Feb 2008
Posts: 26
Reputation: brr is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
brr brr is offline Offline
Light Poster

Re: Confirmation message

  #6  
Mar 5th, 2008
iam inserting data in
bs_add.jsp (in this i used some ajax code)
after cick submission
it calls bs_insert.jsp( here i didn't use any html code)here iam inserting data into database,
using jsp with out click event iam using sendRedirect go back to the
bs.jsp
In bs.jsp i want get insert data successfully
Reply With Quote  
Join Date: Jan 2008
Location: Bangalore, India
Posts: 327
Reputation: DangerDev is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 31
DangerDev's Avatar
DangerDev DangerDev is offline Offline
Posting Whiz

Re: Confirmation message

  #7  
Mar 5th, 2008
hi
redirect to the bs.jsp with some GET of POST data, on the basis of this data you can design bs.jsp such that it will show the message.
A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila.
~Mitch Ratcliffe
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JavaScript / DHTML / AJAX Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 10:41 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC