The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Two forms on one page.
sh0wtym3
post Sep 27 2008, 11:55 PM
Post #1





Group: Members
Posts: 1
Joined: 27-September 08
Member No.: 6,760



Hey all,

I have two forms on my page (shown below in order of appearance). The 2nd form works and redirects you to the page "change-password.php" as it should, but the 1st form does NOT work correctly - it redirects to "change-password.php" too. I don't know what I'm doing wrong, the form action clearly states "uploadconfig.php" but it still tries to send the information to "change-password.php" instead.

Thanks in advance.

CODE
<form action="uploadconfig.php" method="post" enctype="multipart/form-data" name="frm_upload" id="frm_upload">
<table border="0" cellspacing="0" cellpadding="0" id="tbl_upload">
<tr>
  <th align="right" scope="row"><span class="style8">
    <label for="frmname">Song Title:   </label>
  </span></th>
  <td><input type="text" name="frmname" id="frmname" class="frmfld" /></td>
</tr>
<tr>
  <th align="right" scope="row"><span class="style8">
    <label for="price">Price:   </label>
  </span></th>
  <td><input type="text" name="price" id="price" class="price" />  (i.e. - $20)</td>
</tr>
<tr>
  <th align="right" scope="row"><span class="style8">
    <label for="frmfile"> File:   </label>
  </span></th>
  <td><input type="hidden" name="MAX_FILE_SIZE" value="<?php echo MAX_FILE_SIZE; ?>" /><input name="frmfile" type="file" id="frmfile" size="30" /></td>
</tr>
<tr>
<th scope="row"> </th>
<td>
<label for="btn" id="sbm">
<input type="submit" name="btn" id="btn" value="Upload" />
</label>
</td>
</tr>
</table>
</form>


CODE
<form action='change-password.php' method=post><input type=hidden name=todo value=change-password><table border='1' bordercolor="#FF0000" cellspacing='0' cellpadding='0' align=center>
<tr bgcolor='#CCCCCC' ><td colspan='2' align='center'><font face='Calibri' size='3' align='center'><b>Change Your Password</b> </font></td>
</tr>

<tr bgcolor='#f1f1f1' > <td ><div align="center"><font color="#000000" face='Calibri' size='3' align='right'>Username</font></div></td> <td  align='center'><font face='Calibri' size='3' >
<input type ='text' class='bginput' name='username' ></font></td></tr>

<tr bgcolor='#f1f1f1' > <td ><div align="center"><font color="#000000" face='Calibri' size='3' align='right'>New Password</font></div></td> <td  align='center'><font face='Calibri' size='3' >
<input type ='password' class='bginput' name='newpassword' ></font></td></tr>

<tr bgcolor='#f1f1f1' > <td ><div align="center"><font color="#000000" face='Calibri' size='3' align='right'>Confirm Password</font></div></td> <td  align='center'><font face='Calibri' size='3' >
<input type ='password' class='bginput' name='confirmnewpassword' ></font></td></tr>
<tr bgcolor='#f1f1f1' ><td colspan=2 align=center><input type=submit value='Change Password'>   <input type=reset value=Reset></font></td></tr></table></form>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Mystic
post Sep 28 2008, 02:58 AM
Post #2





Group: Members
Posts: 5
Joined: 28-September 08
Member No.: 6,761



That's odd, not sure what would be causing that.
First, try adding a name to the second form, if that has no effect try this.
To test something out change the submit input to a button input and do an
CODE
onclick="document.##FORM NAME##.submit();"


That will submit whichever form you have put in for the form name.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Sep 28 2008, 05:18 AM
Post #3


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



Can you provide the URL (address) of a document that demonstrates the problem?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th April 2024 - 09:47 AM