Page 1 of 1

Button click event

Posted: Mon Oct 02, 2006 5:04 pm
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

Posted: Mon Oct 02, 2006 5:09 pm
by Luke
you need to explain your problem more thoroughly, and do not use AOLSpeak. Thanks!

Posted: Mon Oct 02, 2006 5:32 pm
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.

Posted: Tue Oct 03, 2006 12:39 am
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

Posted: Tue Oct 03, 2006 12:43 am
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.

Posted: Tue Oct 03, 2006 6:37 am
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.

Posted: Tue Oct 03, 2006 8:10 am
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.