|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Problem in javascript code.
Hi
I made such code, but once I click any of login links, my $_POST array has only statusx value, but not UserName and PassWord. What should I change? Code:
<script language="Javascript">
function submitForm(action)
{
document.all.formlogin. innerHTML = document.all.formlogin.innerHTML +
"<input type=hidden name=statusx value=" + action + ">";
document.formlogin. submit();
}
</script>
<form name = "formlogin" action = "index.php" method = "POST">
UserName: <input type = "text" name = "UserName"></br></br>
PassWord: <input type = "password" name = "PassWord"></br></br>
<a class = "login" href="javascript: submitForm(\'temp\');"> Temporary Login</a></br>
<a class = "login" href="javascript: submitForm(\'perm\');"> Permanent Login</a>
</form>
Last edited by Shadow Wizard : May 9th, 2008 at 04:19 AM. Reason: removed signature |
|
#2
|
||||
|
||||
|
Code:
UserName: <input type="text" name="UserName"></br></br> PassWord: <input type="password" name="PassWord"></br></br> All the spaces surround = signs for starters are causing malformed HTML syntax and "javascript: submitForm" should be "javascript:submitForm"
__________________
selwonk |
|
#3
|
||||
|
||||
|
Quote:
Quote:
![]() Chetan, Instead of trying to [incorrectly] add to the <form>s HTML, put the hidden field in there by default with an empty value, and simply use the script to set the value of it before submitting.
__________________
Support requests via PM will be ignored! |
|
#4
|
|||
|
|||
|
You have madesome mistakes in html and javascript syntaxes.I would say one thing
clear ur fundamentals. |
|
#5
|
||||
|
||||
|
Quote:
|
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > Problem in javascript code. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|