Jump to content

create a form with a button with $post

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
6 replies to this topic

#1
achi

achi

    Newbie

  • Members
  • Pip
  • 3 posts
please can anyone tell me how i can create a form with a submit button using post.

#2
Orjan

Orjan

    Writes binary right handed and hex left handed

  • Moderators
  • 3,299 posts
<form method="post" action="page.php">
<input type="text" name="field" value="default">
<input type="submit" name="send" value="Send">
</form>
change the page.php to the name of the page which shall receive the post information.
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall

#3
achi

achi

    Newbie

  • Members
  • Pip
  • 3 posts
thanks orjan please do you know how i can include a drop down list menu or checkbox to it and make it return a value depending on the choice selected on the checkbox. i think i will have to use a if statement but dont know how to write it

#4
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
Checkbox:

<input type="checkbox" name="delivery" />Home delivery

Drop down menu:

<select name="dairy">
<option value="cheese">Cheese</option>
<option value="eggs">Eggs</option>
<option value="milk">Milk</option>
</select>

Edited by Xav, 09 March 2009 - 09:08 AM.

Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums

#5
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
I would suggest you read the HTML tutorials at W3Schools Online Web Tutorials

Edited by WingedPanther, 09 March 2009 - 07:31 AM.
fix link

Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#6
Orjan

Orjan

    Writes binary right handed and hex left handed

  • Moderators
  • 3,299 posts

Xav said:

Checkbox:


<input type="delivery" name="field" />Home delivery


Hmm.. no, that's not right.


<input type="checkbox" name="delivery" name="field" />Home delivery


works better.

WingedPanther said:

I would suggest you read the HTML tutorials at w3shools.com

Better to link to the real site. W3Schools Online Web Tutorials
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall

#7
Xav

Xav

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 13,118 posts
@orjan: Typo sorry. Fixed.
Jordan said:

Good members, like yourself, stick around and post for ages to come!
Mr. Xav | Blog | Forums