FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » On click button in php
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
On click button in php [message #180444] Sat, 16 February 2013 02:15 Go to next message
Nagaraju Kachapuram is currently offline  Nagaraju Kachapuram
Messages: 14
Registered: February 2013
Karma: 0
Junior Member
<form name="myform" action="details.php?id=<?php echo $id ?>" method=get>
<li><a href="#">
Enter Id:<br/><input type="text" value="Enter Id Code" name=id onfocus="if (this.value == 'Enter Id Code') {this.value = '';}"></a>
<?php echo $id ?>
</li>
<li>
<a href="#"><input type="button" onclick="<a href='details.php?$id=' ></a>" value="submit" style="margin-left:4.0em;"></a>

Problem:

The text box is accepting the id code and when I press enter it is activating the details.php but when I click the button (the submit button) nothing is happening.

Please help me.
Re: On click button in php [message #180445 is a reply to message #180444] Sat, 16 February 2013 02:48 Go to previous messageGo to next message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma: 0
Senior Member
On 2/15/2013 9:15 PM, nag wrote:
> <form name="myform" action="details.php?id=<?php echo $id ?>" method=get>
> <li><a href="#">
> Enter Id:<br/><input type="text" value="Enter Id Code" name=id onfocus="if (this.value == 'Enter Id Code') {this.value = '';}"></a>
> <?php echo $id ?>
> </li>
> <li>
> <a href="#"><input type="button" onclick="<a href='details.php?$id=' ></a>" value="submit" style="margin-left:4.0em;"></a>
>
> Problem:
>
> The text box is accepting the id code and when I press enter it is activating the details.php but when I click the button (the submit button) nothing is happening.
>
> Please help me.
>

onclick executes javascript code on the client. PHP runs on the server
(and is NOT javascript).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
Re: On click button in php [message #180446 is a reply to message #180444] Sat, 16 February 2013 04:29 Go to previous messageGo to next message
Jeff North is currently offline  Jeff North
Messages: 58
Registered: November 2010
Karma: 0
Member
On Fri, 15 Feb 2013 18:15:17 -0800 (PST), in comp.lang.php nag
<visitnag(at)gmail(dot)com>
<3e8c6516-17c4-4a29-9f9f-ace88c524074(at)googlegroups(dot)com> wrote:

> | <form name="myform" action="details.php?id=<?php echo $id ?>" method=get>
> | <li><a href="#">
> | Enter Id:<br/><input type="text" value="Enter Id Code" name=id onfocus="if (this.value == 'Enter Id Code') {this.value = '';}"></a>
> | <?php echo $id ?>
> | </li>
> | <li>

Change this
> | <a href="#"><input type="button" onclick="<a href='details.php?$id=' ></a>" value="submit" style="margin-left:4.0em;"></a>

to:
<input type='submit' value='submit' style="margin-left:4.0em;">


> | Problem:
> |
> | The text box is accepting the id code and when I press enter it is activating the details.php but when I click the button (the submit button) nothing is happening.
> |
> | Please help me.
Re: On click button in php [message #180447 is a reply to message #180446] Sat, 16 February 2013 13:20 Go to previous messageGo to next message
Nagaraju Kachapuram is currently offline  Nagaraju Kachapuram
Messages: 14
Registered: February 2013
Karma: 0
Junior Member
On Saturday, 16 February 2013 09:59:29 UTC+5:30, Jeff North wrote:
> On Fri, 15 Feb 2013 18:15:17 -0800 (PST), in comp.lang.php nag
>
> <visitnag(at)gmail(dot)com>
>
> <3e8c6516-17c4-4a29-9f9f-ace88c524074(at)googlegroups(dot)com> wrote:
>
>
>
>> | <form name="myform" action="details.php?id=<?php echo $id ?>" method=get>
>
>> | <li><a href="#">
>
>> | Enter Id:<br/><input type="text" value="Enter Id Code" name=id onfocus="if (this.value == 'Enter Id Code') {this.value = '';}"></a>
>
>> | <?php echo $id ?>
>
>> | </li>
>
>> | <li>
>
>
>
> Change this
>
>> | <a href="#"><input type="button" onclick="<a href='details.php?$id=' ></a>" value="submit" style="margin-left:4.0em;"></a>
>
>
>
> to:
>
> <input type='submit' value='submit' style="margin-left:4.0em;">
>
>
>
>
>
>> | Problem:
>
>> |
>
>> | The text box is accepting the id code and when I press enter it is activating the details.php but when I click the button (the submit button) nothing is happening.
>
>> |
>
>> | Please help me.

thank you so much
Re: On click button in php [message #180449 is a reply to message #180444] Sun, 17 February 2013 07:53 Go to previous messageGo to next message
Arno Welzel is currently offline  Arno Welzel
Messages: 317
Registered: October 2011
Karma: 0
Senior Member
nag, 2013-02-16 03:15:

[...]
> <a href="#"><input type="button" onclick="<a href='details.php?$id=' ></a>" value="submit" style="margin-left:4.0em;"></a>
>
> Problem:

Your problem seems to be, that you really miss fundamental understanding
of the technologies you use.

[...]
> but when I click the button (the submit button) nothing is happening.

Of course not. onClick is an event handler and you have to use
JavaScript there.


--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
Re: On click button in php [message #180451 is a reply to message #180449] Sun, 17 February 2013 20:09 Go to previous messageGo to next message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma: 0
Senior Member
Arno Welzel wrote:

> nag, 2013-02-16 03:15:
> [...]
>> <a href="#"><input type="button" onclick="<a href='details.php?$id='
>>> </a>" value="submit" style="margin-left:4.0em;"></a>
>>
>> Problem:
>
> Your problem seems to be, that you really miss fundamental understanding
> of the technologies you use.

Pot, kettle, black.

> [...]
>> but when I click the button (the submit button) nothing is happening.
>
> Of course not. onClick is an event handler and you have to use
> JavaScript there.

“onclick” is an event-handler attribute (for the “click” event of the DOM),
and unless the HTML version is HTML5, one can use any scripting language in
its value. ECMAScript-based scripting languages like JavaScript are best
supported, though.

See also: <http://PointedEars.de/es-matrix>


PointedEars
--
Sometimes, what you learn is wrong. If those wrong ideas are close to the
root of the knowledge tree you build on a particular subject, pruning the
bad branches can sometimes cause the whole tree to collapse.
-- Mike Duffy in cljs, <news:Xns9FB6521286DB8invalidcom(at)94(dot)75(dot)214(dot)39>
Re: On click button in php [message #180463 is a reply to message #180451] Tue, 19 February 2013 10:18 Go to previous messageGo to next message
Arno Welzel is currently offline  Arno Welzel
Messages: 317
Registered: October 2011
Karma: 0
Senior Member
Thomas 'PointedEars' Lahn, 2013-02-17 21:09:

> Arno Welzel wrote:
>
>> nag, 2013-02-16 03:15:
>> [...]
>>> <a href="#"><input type="button" onclick="<a href='details.php?$id='
>>>> </a>" value="submit" style="margin-left:4.0em;"></a>
[...]
>>> but when I click the button (the submit button) nothing is happening.
>>
>> Of course not. onClick is an event handler and you have to use
>> JavaScript there.
>
> “onclick” is an event-handler attribute (for the “click” event of the DOM),
> and unless the HTML version is HTML5, one can use any scripting language in
> its value. ECMAScript-based scripting languages like JavaScript are best
> supported, though.
>
> See also: <http://PointedEars.de/es-matrix>

Theoretically - yes. In the real world ECMAScript-based scripting
languages like JavaScript are the only useful choice, since none of the
current browsers except Internet Explorer support anything else out of
the box.


--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
Re: On click button in php [message #180464 is a reply to message #180463] Tue, 19 February 2013 10:23 Go to previous messageGo to next message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma: 0
Senior Member
Arno Welzel wrote:

> Thomas 'PointedEars' Lahn, 2013-02-17 21:09:
>> Arno Welzel wrote:
>>> nag, 2013-02-16 03:15:
>>> [...]
>>>> <a href="#"><input type="button" onclick="<a href='details.php?$id='
>>>> > </a>" value="submit" style="margin-left:4.0em;"></a>
> [...]
>>>> but when I click the button (the submit button) nothing is happening.
>>> Of course not. onClick is an event handler and you have to use
>>> JavaScript there.
>> “onclick” is an event-handler attribute (for the “click” event of the
>> DOM), and unless the HTML version is HTML5, one can use any scripting
>> language in its value. ECMAScript-based scripting languages like
>> JavaScript are best supported, though.
>>
>> See also: <http://PointedEars.de/es-matrix>
>
> Theoretically - yes. In the real world ECMAScript-based scripting
> languages like JavaScript are the only useful choice, since none of the
> current browsers except Internet Explorer support anything else out of
> the box.

That is what I said.


PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
Re: On click button in php [message #180467 is a reply to message #180464] Tue, 19 February 2013 10:51 Go to previous messageGo to next message
Arno Welzel is currently offline  Arno Welzel
Messages: 317
Registered: October 2011
Karma: 0
Senior Member
Thomas 'PointedEars' Lahn, 2013-02-19 11:23:

> Arno Welzel wrote:
>
>> Thomas 'PointedEars' Lahn, 2013-02-17 21:09:
>>> Arno Welzel wrote:
>>>> nag, 2013-02-16 03:15:
>>>> [...]
>>>> > <a href="#"><input type="button" onclick="<a href='details.php?$id='
>>>> >> </a>" value="submit" style="margin-left:4.0em;"></a>
>> [...]
>>>> > but when I click the button (the submit button) nothing is happening.
>>>> Of course not. onClick is an event handler and you have to use
>>>> JavaScript there.
>>> “onclick” is an event-handler attribute (for the “click” event of the
>>> DOM), and unless the HTML version is HTML5, one can use any scripting
>>> language in its value. ECMAScript-based scripting languages like
>>> JavaScript are best supported, though.
>>>
>>> See also: <http://PointedEars.de/es-matrix>
>>
>> Theoretically - yes. In the real world ECMAScript-based scripting
>> languages like JavaScript are the only useful choice, since none of the
>> current browsers except Internet Explorer support anything else out of
>> the box.
>
> That is what I said.

To make it more clear: ECMAScript-based languages like JavaScript are
not only the "best supported" ones - they are the ONLY possibility in
the real world and it does not matter if is theoretically possible to
specify another language for the event-handler and if there is one(!)
known browser to support VBScript instead of JScript.


--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
Re: On click button in php [message #180468 is a reply to message #180467] Tue, 19 February 2013 10:58 Go to previous messageGo to next message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma: 0
Senior Member
Arno Welzel wrote:

> Thomas 'PointedEars' Lahn, 2013-02-19 11:23:
>> Arno Welzel wrote:
>>> Thomas 'PointedEars' Lahn, 2013-02-17 21:09:
>>>> Arno Welzel wrote:
>>>> > nag, 2013-02-16 03:15:
>>>> > [...]
>>>> >> <a href="#"><input type="button" onclick="<a href='details.php?$id='
>>>> >>> </a>" value="submit" style="margin-left:4.0em;"></a>
>>> [...]
>>>> >> but when I click the button (the submit button) nothing is happening.
>>>> > Of course not. onClick is an event handler and you have to use
>>>> > JavaScript there.
>>>> “onclick” is an event-handler attribute (for the “click” event of the
>>>> DOM), and unless the HTML version is HTML5, one can use any scripting
>>>> language in its value. ECMAScript-based scripting languages like
>>>> JavaScript are best supported, though.
>>>>
>>>> See also: <http://PointedEars.de/es-matrix>
>>>
>>> Theoretically - yes. In the real world ECMAScript-based scripting
>>> languages like JavaScript are the only useful choice, since none of the
>>> current browsers except Internet Explorer support anything else out of
>>> the box.
>>
>> That is what I said.
>
> To make it more clear: ECMAScript-based languages like JavaScript are
> not only the "best supported" ones - they are the ONLY possibility in
> the real world

You are mistaken. Companies are using that fact to their advantage.

> and it does not matter if is theoretically possible to specify another
> language for the event-handler and if there is one(!) known browser to
> support VBScript instead of JScript.

It is still possible. A “real world” argument is, of course, a common
fallacy.


PointedEars
--
> If you get a bunch of authors […] that state the same "best practices"
> in any programming language, then you can bet who is wrong or right...
Not with javascript. Nonsense propagates like wildfire in this field.
-- Richard Cornford, comp.lang.javascript, 2011-11-14
Re: On click button in php [message #180469 is a reply to message #180468] Tue, 19 February 2013 12:07 Go to previous messageGo to next message
Doug Miller is currently offline  Doug Miller
Messages: 171
Registered: August 2011
Karma: 0
Senior Member
Thomas 'PointedEars' Lahn <PointedEars(at)web(dot)de> wrote in
news:5349567(dot)eTz8zpLT7E(at)PointedEars(dot)de:

> It is still possible. A “real world” argument is, of course, a common
> fallacy.

Please turn off "smart quotes" in your news client before you post again.
Re: On click button in php [message #180471 is a reply to message #180467] Tue, 19 February 2013 12:13 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
On 19/02/13 10:51, Arno Welzel wrote:

>
> To make it more clear: ECMAScript-based languages like JavaScript are
> not only the "best supported" ones - they are the ONLY possibility in
> the real world and it does not matter if is theoretically possible to
> specify another language for the event-handler and if there is one(!)
> known browser to support VBScript instead of JScript.
>
>
Unless the client side is under control as in e.g., a company intranet.


--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
Re: On click button in php [message #180475 is a reply to message #180468] Wed, 20 February 2013 10:00 Go to previous messageGo to next message
Arno Welzel is currently offline  Arno Welzel
Messages: 317
Registered: October 2011
Karma: 0
Senior Member
Am 19.02.2013 11:58, schrieb Thomas 'PointedEars' Lahn:
> Arno Welzel wrote:
>
>> Thomas 'PointedEars' Lahn, 2013-02-19 11:23:
>>> Arno Welzel wrote:
>>>> Thomas 'PointedEars' Lahn, 2013-02-17 21:09:
>>>> > Arno Welzel wrote:
>>>> >> nag, 2013-02-16 03:15:
>>>> >> [...]
>>>> >>> <a href="#"><input type="button" onclick="<a href='details.php?$id='
>>>> >>>> </a>" value="submit" style="margin-left:4.0em;"></a>
>>>> [...]
>>>> >>> but when I click the button (the submit button) nothing is happening.
>>>> >> Of course not. onClick is an event handler and you have to use
>>>> >> JavaScript there.
>>>> > “onclick” is an event-handler attribute (for the “click” event of the
>>>> > DOM), and unless the HTML version is HTML5, one can use any scripting
>>>> > language in its value. ECMAScript-based scripting languages like
>>>> > JavaScript are best supported, though.
>>>> >
>>>> > See also: <http://PointedEars.de/es-matrix>
>>>>
>>>> Theoretically - yes. In the real world ECMAScript-based scripting
>>>> languages like JavaScript are the only useful choice, since none of the
>>>> current browsers except Internet Explorer support anything else out of
>>>> the box.
>>>
>>> That is what I said.
>>
>> To make it more clear: ECMAScript-based languages like JavaScript are
>> not only the "best supported" ones - they are the ONLY possibility in
>> the real world
>
> You are mistaken. Companies are using that fact to their advantage.
>
>> and it does not matter if is theoretically possible to specify another
>> language for the event-handler and if there is one(!) known browser to
>> support VBScript instead of JScript.
>
> It is still possible. A “real world” argument is, of course, a common
> fallacy.

Man context

The OP did not talk about a company intranet.




--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
Re: On click button in php [message #180476 is a reply to message #180471] Wed, 20 February 2013 10:01 Go to previous messageGo to next message
Arno Welzel is currently offline  Arno Welzel
Messages: 317
Registered: October 2011
Karma: 0
Senior Member
Am 19.02.2013 13:13, schrieb The Natural Philosopher:
> On 19/02/13 10:51, Arno Welzel wrote:
>
>>
>> To make it more clear: ECMAScript-based languages like JavaScript are
>> not only the "best supported" ones - they are the ONLY possibility in
>> the real world and it does not matter if is theoretically possible to
>> specify another language for the event-handler and if there is one(!)
>> known browser to support VBScript instead of JScript.
>>
>>
> Unless the client side is under control as in e.g., a company intranet.

Which is just one special use case - and i doubt the OP is involved in
creating something for a company intranet ;-)


--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
Re: On click button in php [message #180477 is a reply to message #180476] Wed, 20 February 2013 13:48 Go to previous message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
On 20/02/13 10:01, Arno Welzel wrote:
> Am 19.02.2013 13:13, schrieb The Natural Philosopher:
>> On 19/02/13 10:51, Arno Welzel wrote:
>>
>>>
>>> To make it more clear: ECMAScript-based languages like JavaScript are
>>> not only the "best supported" ones - they are the ONLY possibility in
>>> the real world and it does not matter if is theoretically possible to
>>> specify another language for the event-handler and if there is one(!)
>>> known browser to support VBScript instead of JScript.
>>>
>>>
>> Unless the client side is under control as in e.g., a company intranet.
>
> Which is just one special use case - and i doubt the OP is involved in
> creating something for a company intranet ;-)
>
>
so do I, but its amazing the responses I got when I was doing just that,
and people 'assumed' that the only valid use of php was for publicly
globally accessible websites...

'dont use javascript or cookies: they may not have them enabled: don't
just code for IE6/7/8 and firefox, they might have opera or safari:
remember to make provision for blind people and people using smart
phones and tablets..' etc etc.

All of that is irrelevant when you know that only 5 sighted people all
on IE6 and/or Firefox with at least 1024x768 screens will ever be using it..

--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: using scripting languages to automate a browser
Next Topic: utf8_encode(utf8_decode(string)) doesn't return same string
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 10 06:15:27 GMT 2024

Total time taken to generate the page: 0.02859 seconds