473,657 Members | 2,449 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to submit the data although it return false?

150 New Member
im having two problems with my site, i wrote Javascript code into my page to return true if the data that was entered was correct else return false and im having two buttons to submit the data
EX:


this button to check for availability and the other to check that all data are correct to insert into it database in the same form.
EX:


The other problem, i want to login in the same page im already on and make the form disappear when i enter the correct data how to do that
EX:

Jul 23 '07 #1
2 1381
nathj
938 Recognized Expert Contributor
im having two problems with my site, i wrote Javascript code into my page to return true if the data that was entered was correct else return false and im having two buttons to submit the data
EX:


this button to check for availability and the other to check that all data are correct to insert into it database in the same form.
EX:


The other problem, i want to login in the same page im already on and make the form disappear when i enter the correct data how to do that
EX:

If I understand, and forgive me if I don't, you want the login page to POST the form data back to itself and then display something different if the login was sucessful?

If this is the case I would have the login page first check $_POST data to see if the items have been set. If they have then check if they are correct. If they have not then display the form.

If the items are correct display what you want to display to users logged in otherwise show the form with some text explaining the error and offering help such as reminders.

Here's some psuedo code.
Expand|Select|Wrap|Line Numbers
  1. if (isset($_POST['user']) && isset($_POST['password']))
  2. {
  3.   if(username=valid && password=valid) //psuedocode
  4.   {
  5.   $lnIsValid  0;
  6.   }
  7.   else
  8.   {
  9.   $lnIsValid = 2;
  10.   }
  11. }
  12. else // not set
  13. {
  14.   $lnIsValid = 1;
  15. }
  16.  
  17. switch($lnIsValid)
  18. {
  19.   case 0:
  20.    echo "Welcome";
  21.    break;
  22.   case 1: // display form for the first time
  23.    include("form.php") ; // we can then use this later
  24.    break;
  25.   case 2:
  26.    include("form.php");
  27.    echo "the data entered did not match do you need assistance"; //offer password reminder etc
  28.   break;
  29. }
  30.  
This is just a quick peice of psuedo code, but hopefully it will point you in the right direction.

Don't forget, you can always post back if you need more help
Cheers
nathj
Jul 23 '07 #2
smartic
150 New Member
Thank you for replay but my real problem is i;m having javascript into the form [HTML]onsubmit="retur n validation()"[/HTML] when i click the availability button it check if all the data are correct and don't return thing thank you.
Jul 25 '07 #3

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

Similar topics

3
24530
by: jeff | last post by:
Hello, I have a form that submits it's values to a pop-up window. I've simplied the code: <form name="formname" action="action.php" target="windowName" method="post" onsubmit="window.open('', this.target, 'dialog,modal,scrollbars=yes,resizable=no,width=300,height=200,left=362,top=284');">
1
8321
by: Stanimir Stamenkov | last post by:
Here's an example: <form action="bogus" method="post"> <p> <a href="prev.cgi"><input type="submit" name="prev" value="< Back"></a> <a href="next.cgi"><input type="submit" name="next" value="Next >"></a> </p> </form>
10
19342
by: Gregory A Greenman | last post by:
I'm trying to write a program in vb.net to automate filling out a series of forms on a website. There are three forms I need to fill out in sequence. The first one is urlencoded. My program is able to fill that one out just fine. The second form is multipart/form-data. Unfortunately, I haven't been able to fill that out in a way that makes the server happy. I set up a copy of this form at my web site so that I could see exactly what a...
3
1422
by: Matt | last post by:
When the user click the submit button in myform.asp, then it will invoke the javascript to check the form data. I want to know if we need document.myform.submit(); ?? Because even I comment it out, formresponse.asp could still get the form data. //myform.asp <script type="text/javascript"> function checkformdata()
2
4892
by: Margaret Werdermann | last post by:
Hi all: I'm having a nasty time with a particularly difficult piece of code and was hoping someone might be able to help me. I have a FormMail form that originally worked perfectly. Then, I had to add a JavaScript function to the Submit button to make a server function run when the form was submitted. Unfortunately, this JavaScript wouldn't run when the button was designated as a Submit, so I changed the button and placed a...
1
3426
by: Piotr | last post by:
I have popup window (window.open) where I put any value in input field. After submit I wan to to return to the main window and get value from popup window. How to close popup window and return to the main after submit?
8
3351
by: horos | last post by:
hey all, Ok, a related question to my previous one on data dumpers for postscript. In the process of putting a form together, I'm using a lot of placeholder variables that I really don't care about in the submitted action. I'd therefore like to get rid of them by doing something like:
4
3500
by: John Boy | last post by:
Hi, Can anyone help. This is really doing my nut in. 3 years ASP exp. and now doing .DOT which is a step in the wrong direction. Basically I am left with the code of a guy who has left. When I click a button on a pop-up window the javascript for that button click does a 'button.form.submit'. On the Server side there is a Button click event for this button, but for some reason it no longer fires. It worked fine before and everything...
6
4984
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing for long running reports. When the processing is complete it uses crystal reports to load a template file, populate it, and then export it to a PDF. It works fine so far....
0
8310
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8826
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...
1
8503
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
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6166
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
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4155
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...
0
4306
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1615
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.