| | |
How to use two forms in asp
Please support our ASP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Apr 2005
Posts: 4
Reputation:
Solved Threads: 0
Hi everybody
Can some one help me out??
My problem is
I am using two forms in my asp page
form1 is used to upload photo, so I used enctype for it and action form1update.asp
and a submit button attached
when clicking on the submit button it should upload file using form1update.asp
form2 consists of 3 text boxes and submit button
action for form2 is form2update.asp
when clicking on submit button in form2, it should update all the details into database using form2update.asp
my problem is whenever i am clicking on upload button (submit button) in form1, instead of action form1update.asp, its going into form2update.asp
can u help me out on this!!!
thanks in advance
Can some one help me out??
My problem is
I am using two forms in my asp page
form1 is used to upload photo, so I used enctype for it and action form1update.asp
and a submit button attached
when clicking on the submit button it should upload file using form1update.asp
form2 consists of 3 text boxes and submit button
action for form2 is form2update.asp
when clicking on submit button in form2, it should update all the details into database using form2update.asp
my problem is whenever i am clicking on upload button (submit button) in form1, instead of action form1update.asp, its going into form2update.asp
can u help me out on this!!!
thanks in advance
•
•
Join Date: May 2005
Posts: 1
Reputation:
Solved Threads: 0
I hate to jump in here, but I am having a very similar problem and thought maybe someone could, PLEASE, help. I have two forms. The first form is for for user login and has an onSubmit link to validate the fields. When the submit button is hit for this form, it uses the onSubmit link but then proceeds to use the action from the second form. This only happens if the second forms submit button has been used. Here is the code for the first form:
<form method="post" name="FrmLogin" onSubmit="return Validate_FrmLogin()" action="<?php echo $CONST_LINK_ROOT?>/prglogin.php">
<tr>
<td align="left"><?php echo LOGIN_USERNAME?>
</td>
</tr>
<tr>
<td align="left"><input type="text" class="input" name="txtHandle" size="20" tabindex="1" value="<?=$HTTP_COOKIE_VARS[txtHandle_c]?>">
</td>
</tr>
<tr>
<td align="left"><?php echo LOGIN_PASSWORD ?>
</td>
</tr>
<tr>
<td align="left" class="tdeven" > <input name="txtPassword" type="password" class="input" tabindex="2" value="<?=$HTTP_COOKIE_VARS[txtPassword_c]?>" size="20">
</td>
</tr>
<tr>
<td align="left" class="tdodd"><?php echo LOGIN_LOG_AUTOMATICALY ?>
<input type=checkbox name="save"<?php if(isset($HTTP_COOKIE_VARS[txtHandle_c])) echo ' checked' ?>>
</td>
</tr>
<tr >
<td colspan="1" align="left"> <input name="submit" type="submit" class="button" value='<?= BUTTON_LOGIN ?>'>
</td>
</tr>
</form>
and, the code for the second form:
<form name="dating service" method="POST" action="prgminisearch.php">
<tr>
<td height="30" valign="top"><strong>Search for a Date...</strong>
</td>
</tr>
<tr>
<td class="smallest" height="20" valign="bottom"><strong>I am a</strong>
</td>
</tr>
<tr>
<td><select name="lstDatingFrom" size="1" class="inputf">
<option value='M' selected><?php echo GENDER_M?></option>
<option value='F'><?php echo GENDER_W?></option>
<option value='C'><?php echo GENDER_C?></option>
</select>
</td>
</tr>
<tr>
<td class="smallest" height="20" valign="bottom"><strong>Seeking a</strong>
</td>
</tr>
<tr>
<td class="smalltext"><select name="lstDatingTo" size="1" class="inputf">
<option value='M'><?php echo GENDER_M?></option>
<option value='F' selected><?php echo GENDER_W?></option>
<option value='C'><?php echo GENDER_C?></option>
</select>
</td>
</tr>
<tr>
<td class="smallest" height="20" valign="bottom"><strong>Located in</strong>
</td>
<td> </td>
</tr>
<tr>
<td><select name="lstDatingCountry" class="inputf">
<option selected value="0">
<?=SEARCH_ALLCOUNTRIES?>
</option>
<?while ($country_row = mysql_fetch_object($country_res)){?>
<option value="<?=$country_row->gcn_countryid?>">
<?=$country_row->gcn_name?>
</option>
<?}?>
</select>
</td>
<td><input type="image" src="images/go.gif" style="border:0px solid #ffffff;" width="20" height="21" alt="dating service search" name="dating service search">
</td>
</tr>
</form>
If anyone knows a way around this predicament, please help.
<form method="post" name="FrmLogin" onSubmit="return Validate_FrmLogin()" action="<?php echo $CONST_LINK_ROOT?>/prglogin.php">
<tr>
<td align="left"><?php echo LOGIN_USERNAME?>
</td>
</tr>
<tr>
<td align="left"><input type="text" class="input" name="txtHandle" size="20" tabindex="1" value="<?=$HTTP_COOKIE_VARS[txtHandle_c]?>">
</td>
</tr>
<tr>
<td align="left"><?php echo LOGIN_PASSWORD ?>
</td>
</tr>
<tr>
<td align="left" class="tdeven" > <input name="txtPassword" type="password" class="input" tabindex="2" value="<?=$HTTP_COOKIE_VARS[txtPassword_c]?>" size="20">
</td>
</tr>
<tr>
<td align="left" class="tdodd"><?php echo LOGIN_LOG_AUTOMATICALY ?>
<input type=checkbox name="save"<?php if(isset($HTTP_COOKIE_VARS[txtHandle_c])) echo ' checked' ?>>
</td>
</tr>
<tr >
<td colspan="1" align="left"> <input name="submit" type="submit" class="button" value='<?= BUTTON_LOGIN ?>'>
</td>
</tr>
</form>
and, the code for the second form:
<form name="dating service" method="POST" action="prgminisearch.php">
<tr>
<td height="30" valign="top"><strong>Search for a Date...</strong>
</td>
</tr>
<tr>
<td class="smallest" height="20" valign="bottom"><strong>I am a</strong>
</td>
</tr>
<tr>
<td><select name="lstDatingFrom" size="1" class="inputf">
<option value='M' selected><?php echo GENDER_M?></option>
<option value='F'><?php echo GENDER_W?></option>
<option value='C'><?php echo GENDER_C?></option>
</select>
</td>
</tr>
<tr>
<td class="smallest" height="20" valign="bottom"><strong>Seeking a</strong>
</td>
</tr>
<tr>
<td class="smalltext"><select name="lstDatingTo" size="1" class="inputf">
<option value='M'><?php echo GENDER_M?></option>
<option value='F' selected><?php echo GENDER_W?></option>
<option value='C'><?php echo GENDER_C?></option>
</select>
</td>
</tr>
<tr>
<td class="smallest" height="20" valign="bottom"><strong>Located in</strong>
</td>
<td> </td>
</tr>
<tr>
<td><select name="lstDatingCountry" class="inputf">
<option selected value="0">
<?=SEARCH_ALLCOUNTRIES?>
</option>
<?while ($country_row = mysql_fetch_object($country_res)){?>
<option value="<?=$country_row->gcn_countryid?>">
<?=$country_row->gcn_name?>
</option>
<?}?>
</select>
</td>
<td><input type="image" src="images/go.gif" style="border:0px solid #ffffff;" width="20" height="21" alt="dating service search" name="dating service search">
</td>
</tr>
</form>
If anyone knows a way around this predicament, please help.
this is an asp forum i cant understand php.
ok why not put both forms fields on 1 forum? if you need the second form to retrieve a record from the first form put an if then statement
if form1=submit then
form 2
else
form 1
end if
to my knowledge you cant see if a form was submited so you add a url thing similar to "index.asp?login=true" the if is if the url login=true then
hope it helps if not let me know what you hope to achieve, dont expect any php code though
ok why not put both forms fields on 1 forum? if you need the second form to retrieve a record from the first form put an if then statement
if form1=submit then
form 2
else
form 1
end if
to my knowledge you cant see if a form was submited so you add a url thing similar to "index.asp?login=true" the if is if the url login=true then
hope it helps if not let me know what you hope to achieve, dont expect any php code though
•
•
Join Date: Jul 2005
Posts: 3
Reputation:
Solved Threads: 0
Hi...
I have tried with my code... which have two forms..
the first form is to upload the page and second if we submit the form it displays the form entries...
Its working fine...
see each submit button have different events..
there is no confusion... unless otherwise it goes to different asp pages...
Thanks and Regards,
UmaParvathy G K
I have tried with my code... which have two forms..
the first form is to upload the page and second if we submit the form it displays the form entries...
Its working fine...
see each submit button have different events..
there is no confusion... unless otherwise it goes to different asp pages...
Thanks and Regards,
UmaParvathy G K
![]() |
Similar Threads
Other Threads in the ASP Forum
- Previous Thread: Database Connectivity in WML pages
- Next Thread: Optimize this code?
| Thread Tools | Search this Thread |
archive asp asp.net aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection calendar changeable connection current database databaseconnection diagnostics dreamweaver excel fso html iis microsoft msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile record searchbox selectoption server single specfic sqlserver sqlserverconnection toolkit web webserver windows7





