On click button in php [message #180444] |
Fri, 15 February 2013 21:15  |
|
<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] |
Fri, 15 February 2013 21:48   |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma: 0
|
Senior Member |
add to buddy list ignore all messages by this user
|
|
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] |
Fri, 15 February 2013 23:29   |
|
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 08:20   |
|
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 #180451 is a reply to message #180449] |
Sun, 17 February 2013 15: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>
>>
>> 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 05:18   |
Arno Welzel
Messages: 317 Registered: October 2011
Karma: 0
|
Senior Member |
add to buddy list ignore all messages by this user
|
|
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 05: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.
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 05:51   |
Arno Welzel
Messages: 317 Registered: October 2011
Karma: 0
|
Senior Member |
add to buddy list ignore all messages by this user
|
|
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 05:58   |
|
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 #180475 is a reply to message #180468] |
Wed, 20 February 2013 05:00   |
Arno Welzel
Messages: 317 Registered: October 2011
Karma: 0
|
Senior Member |
add to buddy list ignore all messages by this user
|
|
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 05:01   |
Arno Welzel
Messages: 317 Registered: October 2011
Karma: 0
|
Senior Member |
add to buddy list ignore all messages by this user
|
|
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
|
|
|
|