|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hello,
I need to set-up a form that can obtain a username and password and provide two selections. So a visitor would type in his/her username and password, place a checkmark in box "A" or "B" and click login. If they check "A" the username and password would be passed to http://www.someplace.com/login.cgi if they check "B" they would be sent to http://www/otherplace.com/login.cgi . So far i have one of the ones working the one within this code... ie: e-mail... can't figure out the other link though... any help would be appreciated. <FORM NAME="logon" METHOD="POST" ACTION="http://someplace.com:8080/login.cgi" target="_blank"> <INPUT TYPE="hidden" NAME="page" VALUE="login"> <TD> <div align="center"><FONT SIZE="1" FACE="Arial, Helvetica"><strong>USERID:<br></strong></FONT> <INPUT TYPE="text" SIZE="20" NAME="userid"> </div></TD> <TR> <TD> <div align="center"><FONT SIZE="1" FACE="Arial, Helvetica"><strong>PASSWORD:<br></strong></FONT> <INPUT TYPE="password" SIZE="20" NAME="passwd"> </div></TD> </TR> <TR> <TD><div align="center"> <INPUT class="niceinput" TYPE="submit" VALUE="Logon" onClick="return formSubmit(this.form);"> <INPUT class="niceinput" TYPE="button" VALUE="Help" onClick="openHelp('cs_login')" onMouseOver="statusBarMsg(help)" onMouseOut="statusBarMsg(current)"> </div></TD> </TR> <tr><TD><INPUT NAME="Expire_Cache" TYPE="checkbox" VALUE="1" checked> <FONT FACE="Arial, Helvetica" SIZE="1"> <strong>Check E-mail</strong></FONT> </TD> </tr> <tr><TD> <INPUT TYPE="checkbox" NAME="Use_Cookie" VALUE="1"> <FONT FACE="Arial, Helvetica" SIZE="1"> <strong>Account Management</strong></FONT></TD> </tr> </FORM> --- HiJinX --- |
|
#2
|
|||
|
|||
|
reply
I could not get you properly. As far as I have understood, u want the form to be posted to one of the sites depending on which checkbox the user chooses. If this is the case, the code should be simple. First of all, remove the ACTION attribute of the form. Set the id attribute of the form as 'logon' (this is the same value as that of the attribute 'name'). Then, in the formSubmit method, u should first check which checkbox has been checked (please make sure that the user is able to select only one checkbox). Then, depending on the checkbox, set the action attribute of the form dinamically, like
document.all.logon.action = ""; The say document.all.logon.submit. This should work. |
|
#3
|
|||
|
|||
|
I just joined to get similar answers that you are seeking. I have found some gond things in your code and have examined the definition and additional amount and found the following note:
If you click the "Submit" button, you will send your input to a new page called form_action.asp. Looks like you can go to exactly ONE page. So send to logon.html and since input items are available, process with if condition. If "A" then form action to someplace else froma action to other place. Now you have split to two forms based upon the "A" OR "B" condition and resubmit all other items to one of the two pages. I'll need to use PHP to verify that the username & password are in the database and send them to welcome screen and set logon var on. Else send to access denied screen and set logon var to off. Hmmm, can a hacker find this var and somehow force it to be on? |
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > Help with Forms and linking external site |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|