| | |
form coding
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Mar 2008
Posts: 4
Reputation:
Solved Threads: 0
i have a problem with my form. there are 2 button : a login and a register button . login but will redirect to welcome.php, register to register.php. i put the action in the form like this
<form name="login" method="post" action="welcome.php" >
the problem is both buttons turn me to welcome.php, how can i solve this ? thanks alot
<form name="login" method="post" action="welcome.php" >
the problem is both buttons turn me to welcome.php, how can i solve this ? thanks alot
•
•
Join Date: Mar 2008
Posts: 154
Reputation:
Solved Threads: 19
You must close each form with </form> and make sure that one form is not within another.
Matti Ressler
Suomedia
Matti Ressler
Suomedia
If you want your dreams to come true, the first thing you must do is to wake up....
Suomedia - Dynamic Content Management
Suomedia - Dynamic Content Management
php Syntax (Toggle Plain Text)
<html> <body> <form method="post" name="test"> <input type="button" name="button1" value="login" onClick="javascript: document.test.action='login.php';document.test.submit();"><input type="button" name="button2" value="Register" onClick="javascript: document.test.action='register.php';document.test.submit();"> </form> </body> </html>
You can do it this way.
Ignorance is definitely not bliss!
*PM asking for help will be ignored*
*PM asking for help will be ignored*
•
•
Join Date: Mar 2008
Posts: 154
Reputation:
Solved Threads: 19
And if the user has javascript turned off? Nothing happens, not good.
Your are far better to structure you page in such a way as to not depend on javascript.
Most login/register pages have form inputs for username and password for registered members, and a simple linked button to the registration page if the user is not registered:
Matti Ressler
Suomedia
Your are far better to structure you page in such a way as to not depend on javascript.
Most login/register pages have form inputs for username and password for registered members, and a simple linked button to the registration page if the user is not registered:
PHP Syntax (Toggle Plain Text)
<html> <body> <form method="post" name="test" action='welcome.php';> <input type="submit" name="button1" value="login"><a href="register.php"><input type="button" name="button2" value="Register"></a> </form> </body> </html>
Matti Ressler
Suomedia
If you want your dreams to come true, the first thing you must do is to wake up....
Suomedia - Dynamic Content Management
Suomedia - Dynamic Content Management
•
•
Join Date: Mar 2008
Posts: 154
Reputation:
Solved Threads: 19
•
•
•
•
If javascript is disabled, even the form validation/ajax wouldn't work.
What Ajax? A well written script will function without either javascript or Ajax. A good example: http://holyculturedownload.com/
This is a heavily Ajaxed site. Turn off javascript and it is still functional - this allows it to have Google results like this and for users to still browse the site.
A form should not rely only on javascript for validation - the PHP side should also check the $_POST data.
Matti Ressler
Suomedia
If you want your dreams to come true, the first thing you must do is to wake up....
Suomedia - Dynamic Content Management
Suomedia - Dynamic Content Management
•
•
•
•
What Ajax? A well written script will function without either javascript or Ajax. A good example: http://holyculturedownload.com/
•
•
•
•
A form should not rely only on javascript for validation - the PHP side should also check the $_POST data.
Last edited by nav33n; Mar 31st, 2008 at 3:19 pm.
Ignorance is definitely not bliss!
*PM asking for help will be ignored*
*PM asking for help will be ignored*
•
•
Join Date: Mar 2008
Posts: 154
Reputation:
Solved Threads: 19
•
•
•
•
That unfortunately, didn't work in FF2 when I disabled javascript. Click on the "Listen" button to test. Strangely, even gmail's "send" button didn't work when I disabled javascript.
Now that is pedantic... the "listen" button is clearly a javascript/Ajax control. The point was that the SITE functions without javascript for the purpose of search engine indexing (which it does very well).... I dont believe that Googlebot listens to music
I think you will find that the signup page functions quite fine without Javascript (it does have it).
Similarly, forms should be designed not to be dependent on Javascript to accomplish their purpose. That Gmail fails for something so fundamental is surprising, but not acceptable.
Matti Ressler
Suomedia
Last edited by Suomedia; Mar 31st, 2008 at 4:39 pm.
If you want your dreams to come true, the first thing you must do is to wake up....
Suomedia - Dynamic Content Management
Suomedia - Dynamic Content Management
![]() |
Similar Threads
- To form a palindrome of a given string (C)
- How can I refresh DataBase without closing Form Attached with my Coding (Visual Basic 4 / 5 / 6)
- C++ Coding :: First Ever (C++)
- Sending form email (PHP)
- Dialog Box alongwith Form (Visual Basic 4 / 5 / 6)
- php coding (PHP)
- Coding Ineternet Explorer StatusBar in .NET (ASP.NET)
- help - need coding for file attachment to a cgi file (Windows NT / 2000 / XP)
- cgi - pearl scripting (Windows NT / 2000 / XP)
Other Threads in the PHP Forum
- Previous Thread: Avoiding the same php page from opening in multiple windows
- Next Thread: Need help with PHP order form
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary body broken cakephp checkbox class cms code cron curl database date date/time directory display download dynamic echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link list login loop mail menu mlm mod_rewrite msqli_multi_query multiple mycodeisbad mysql oop parameter parse paypal pdf php problem query radio random recursion regex remote script search seo server sessions sms soap source space sql static structure syntax system table tutorial update upload url validation validator variable video web webdesign wordpress xml youtube





