troubleshooting Question

how to show validation or message in one page

Avatar of tankergoblin
tankergoblin asked on
PHPJScript
5 Comments1 Solution290 ViewsLast Modified:
Hi,


i want to create a form...

my form point to processregistration.php as below
<form method="post" id="customForm" action="processRegistration.php">

at the same time i have validation as below
<?php      
            if( isset($_POST['send'])):
            ?>            
            
                        <div id="error">
                              <ul>
                                    <?php                                        
                                       if(!validateName($_POST['name'])):
                                    ?>
                                          <li><strong>Invalid Name:</strong> We want names with more than 3 letters!</li>
                                    <?php
                                    endif
                                    ?>                                    
                                    
                              </ul>
                        </div>
                  <?php
                  elseif(isset($_POST['send'])):
                  ?>
                        <div id="error" class="valid">
                              <ul>
                                    <li><strong>Congratulations!</strong> All fields are OK ;)</li>
                              </ul>
                        </div>
            <?php
            endif
            ?>

now my problem is if i use action in my form it will direct me to new page...

how to make everything shows in one page. Thank you'.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros