Button click event

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
archanaelenjickal
Forum Newbie
Posts: 2
Joined: Mon Oct 02, 2006 3:27 pm

Button click event

Post by archanaelenjickal »

I wish to dispaly a form when the user clicks the button in PHp... If any1 knows how to go abt ... plzzz help

bye

d11wtq | No CAPITALIZED titles please
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

you need to explain your problem more thoroughly, and do not use AOLSpeak. Thanks!
User avatar
akimm
Forum Contributor
Posts: 460
Joined: Thu Apr 27, 2006 10:50 am
Location: Ypsilanti Michigan, formally Clipsburgh

Post by akimm »

Unfortunately, we can't just write the code for you.

I can tell you, basic HTML knowledge is required, after which, you then need to either have the PHP on that page with your form, or refer to it from an external php file. Just google HTML forms, I guarentee you'll find everything you need to know the html, as for the PHP be more descriptive as to what you need it to do.
archanaelenjickal
Forum Newbie
Posts: 2
Joined: Mon Oct 02, 2006 3:27 pm

Post by archanaelenjickal »

The page contains information about a hotel in html. Now when the user clicks the button it should go to a survey page of the hotel.. had it ben in HTml it could be done by giivng a link to the new page.... I want to implement the button click event using PHP.. rather tahn simple Html or Java script...

So if some1 cud help out
User avatar
daedalus__
DevNet Resident
Posts: 1925
Joined: Thu Feb 09, 2006 4:52 pm

Post by daedalus__ »

Could you please post some code or link to the page in question? I am having trouble understanding what you are trying to say.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

archanaelenjickal wrote:The page contains information about a hotel in html. Now when the user clicks the button it should go to a survey page of the hotel.. had it ben in HTml it could be done by giivng a link to the new page.... I want to implement the button click event using PHP.. rather tahn simple Html or Java script...

So if some1 cud help out
A button click event is something that happens on the user's browser. You can't detect it using PHP. You have two options:

1. HTML - Have a form with just the submit button on it, when the user clicks the button the form is submitted, then the script it's submitted to returns the form you want to display.

2. Javascript - Have the form in a hidden div, and a button that uses Javascript to change the div's display to visible.
User avatar
waradmin
Forum Contributor
Posts: 240
Joined: Fri Nov 04, 2005 2:57 pm

Post by waradmin »

Put this in the head of your page

Code: Select all

<SCRIPT LANGUAGE="JavaScript">
<!-- Original:  Sven David Hildebrandt (shildebr@online.no) -->
<!-- Web Site:  http://home.hia.no/~sdhild99 -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function goToURL() { window.location = "http://YOURURLHERE.com"; }
//  End -->
</script>
Put this as your link in your BODY:

Code: Select all

<form>
<input type=button value="New JavaScripts" onClick="goToURL()">
</form>
Simple google search finds this. There is no reason to do this in PHP... as your not passing ANY information.
Post Reply