Current location: Hot Scripts Forums » Programming Languages » PHP » Submit button on forms


Submit button on forms

Reply
  #1 (permalink)  
Old 08-10-04, 08:36 AM
civrob civrob is offline
Newbie Coder
 
Join Date: Apr 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Javascript but want php Submit button on forms

Hiya Im trying to get my submit button to be a link rather than a button. Alot of buttons make a horrible mess of my site. Any feedback is appriciated.

I found it is possible with javascript but I need to put my own variables in there

PHP Code:

<form action="AddDirectory.php" method="post" name="the_form">

  <
p>Region of Directory:
    <
select name="Region">
      <
option value="NorthWest">NorthWest</option>
      <
option value="NorthEast">NorthEast</option>
      <
option value="SouthWest">SouthWest</option>
      <
option value="SouthEast">SouthEast</option>
      <
option value="Central">Central</option>

    </
select>
    <
br>
    <
br>
  
Name Of Directory:
  <
input name="Name" type="text">
  <
a href="javascript:document.the_form.submit();">Submit</a>
</
p>
</
form
Above displays the Submit as a link which is great just what I need, but what if I want to put my own variable there such as $var instead of Submit tried all sorts and its giving me a headache.... can anyone do it? or is it just impossible?

Last edited by civrob; 08-10-04 at 08:48 AM.
Reply With Quote
  #2 (permalink)  
Old 08-10-04, 10:13 AM
uprightdog uprightdog is offline
Newbie Coder
 
Join Date: Jul 2004
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
I don't see why you shouldn't be able to simply print your variable in the right place?

<a href="javascript:document.the_form.submit();"><?ph p print $var; ?></a>
Reply With Quote
  #3 (permalink)  
Old 08-10-04, 12:22 PM
Keith's Avatar
Keith Keith is offline
Community Liaison
 
Join Date: Feb 2004
Posts: 1,232
Thanks: 1
Thanked 11 Times in 11 Posts
Is it just me, or are all you really asking is how to change the word 'Submit' to another word?
Reply With Quote
  #4 (permalink)  
Old 08-10-04, 01:35 PM
mikaelf mikaelf is offline
Wannabe Coder
 
Join Date: Jun 2004
Location: php[dot]net
Posts: 198
Thanks: 0
Thanked 0 Times in 0 Posts
yes, you can substitute the submit button with html links. the most simple way to do this is by using get method which value for each variable is taken from the form.
__________________
Useful PHP links:
bugs.php.net - for reporting PHP bugs
pear.php.net - PHP extension and application repository
pecl.php.net - get non standard PHP modules, submit yours
www.phpclasses.org - PHP classes repository
Reply With Quote
  #5 (permalink)  
Old 08-10-04, 04:22 PM
Eclipse's Avatar
Eclipse Eclipse is offline
Coding Addict
 
Join Date: May 2004
Location: Long Island, New York
Posts: 356
Thanks: 0
Thanked 0 Times in 0 Posts
or just add:
Code:
<input type="input" value="Submit">
where you want it to be
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to submit a form using a link, not a submit button? Myke311 HTML/XHTML/XML 3 01-12-05 01:26 AM
submit button?? tcooper PHP 3 07-15-04 04:46 AM
submit button tcooper JavaScript 1 07-15-04 02:22 AM
submit form with more than one href submit and no submit button adlinfanus JavaScript 1 03-09-04 06:45 AM
POST without submit button AbelaJohnB PHP 5 01-22-04 07:56 AM


All times are GMT -5. The time now is 04:18 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.