Jump to content

[SOLVED] HTML button


abch624

Recommended Posts

Hi there I want to use text as a button. If you have a look at the code bellow:

<form class="form" method="post" action="newaccount.php">
		<tr>
			<td width="150">				
				<input type="text" name="newaccountname" value="New Account" tabindex="3">
			</td>
			<td align="center" width="32">	<a href="/1STA/newaccount.php">add</a>
			</td>
			<td width="41"> 	
			</td>
			<td width="41"> 	
			</td>
		</tr>	<!-- PHP BEGIN -->
	</form>

 

I want to use the <a href="/1STA/newaccount.php">add</a> as a button so that the newaccountname is passed to the newaccount.php file.

 

At the moment this is not working and just goes to the newaccount.php path but the variable is not posted.

 

Please help...

Link to comment
https://forums.phpfreaks.com/topic/111887-solved-html-button/
Share on other sites

I have changed the code as per

<form class="form" method="post" name="newaccount" action="newaccount.php">
		<tr>
			<td width="150">				
				<input type="text" name="newaccountname" tabindex="3">
			</td>
			<td align="center" width="32">	<a href="#null" onclick="document.['newaccount'].submit(); return false">add</a>
			</td>
			<td width="41"> 	
			</td>
			<td width="41"> 	
			</td>
		</tr>	<!-- PHP BEGIN -->
	</form>

When I click on the add link the url changes to http://localhost/1STA/accountadmin.php#null and nothing happens.

 

Any help....

 

Cheers - Zahid

Link to comment
https://forums.phpfreaks.com/topic/111887-solved-html-button/#findComment-574310
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.