Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #8378 > unrolled thread

On click button in php

Started bynag <visitnag@gmail.com>
First post2013-02-15 18:15 -0800
Last post2013-02-20 13:48 +0000
Articles 15 — 7 participants

Back to article view | Back to comp.lang.php


Contents

  On click button in php nag <visitnag@gmail.com> - 2013-02-15 18:15 -0800
    Re: On click button in php Jerry Stuckle <jstucklex@attglobal.net> - 2013-02-15 21:48 -0500
    Re: On click button in php Jeff North <jnorthau@yahoo.com.au> - 2013-02-16 15:29 +1100
      Re: On click button in php nag <visitnag@gmail.com> - 2013-02-16 05:20 -0800
    Re: On click button in php Arno Welzel <usenet@arnowelzel.de> - 2013-02-17 08:53 +0100
      Re: On click button in php Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-17 21:09 +0100
        Re: On click button in php Arno Welzel <usenet@arnowelzel.de> - 2013-02-19 11:18 +0100
          Re: On click button in php Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-19 11:23 +0100
            Re: On click button in php Arno Welzel <usenet@arnowelzel.de> - 2013-02-19 11:51 +0100
              Re: On click button in php Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-02-19 11:58 +0100
                Re: On click button in php Doug Miller <doug_at_milmac_dot_com@example.com> - 2013-02-19 12:07 +0000
                Re: On click button in php Arno Welzel <usenet@arnowelzel.de> - 2013-02-20 11:00 +0100
              Re: On click button in php The Natural Philosopher <tnp@invalid.invalid> - 2013-02-19 12:13 +0000
                Re: On click button in php Arno Welzel <usenet@arnowelzel.de> - 2013-02-20 11:01 +0100
                  Re: On click button in php The Natural Philosopher <tnp@invalid.invalid> - 2013-02-20 13:48 +0000

#8378 — On click button in php

Fromnag <visitnag@gmail.com>
Date2013-02-15 18:15 -0800
SubjectOn click button in php
Message-ID<3e8c6516-17c4-4a29-9f9f-ace88c524074@googlegroups.com>
<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.

[toc] | [next] | [standalone]


#8379

FromJerry Stuckle <jstucklex@attglobal.net>
Date2013-02-15 21:48 -0500
Message-ID<kfms1h$n6$1@dont-email.me>
In reply to#8378
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@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#8380

FromJeff North <jnorthau@yahoo.com.au>
Date2013-02-16 15:29 +1100
Message-ID<2n2uh8h2e8mc5gmsaq8ru6ak246rm0c657@4ax.com>
In reply to#8378
On Fri, 15 Feb 2013 18:15:17 -0800 (PST), in comp.lang.php nag
<visitnag@gmail.com>
<3e8c6516-17c4-4a29-9f9f-ace88c524074@googlegroups.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.

[toc] | [prev] | [next] | [standalone]


#8381

Fromnag <visitnag@gmail.com>
Date2013-02-16 05:20 -0800
Message-ID<d75492bb-63f7-475b-8cd7-a4a84832af9b@googlegroups.com>
In reply to#8380
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@gmail.com>
> 
> <3e8c6516-17c4-4a29-9f9f-ace88c524074@googlegroups.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

[toc] | [prev] | [next] | [standalone]


#8383

FromArno Welzel <usenet@arnowelzel.de>
Date2013-02-17 08:53 +0100
Message-ID<51208C68.2000406@arnowelzel.de>
In reply to#8378
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

[toc] | [prev] | [next] | [standalone]


#8385

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2013-02-17 21:09 +0100
Message-ID<2992787.JYnM0pljKP@PointedEars.de>
In reply to#8383
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@94.75.214.39>

[toc] | [prev] | [next] | [standalone]


#8397

FromArno Welzel <usenet@arnowelzel.de>
Date2013-02-19 11:18 +0100
Message-ID<5123516D.5000302@arnowelzel.de>
In reply to#8385
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

[toc] | [prev] | [next] | [standalone]


#8398

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2013-02-19 11:23 +0100
Message-ID<1588617.Iiggtt3da6@PointedEars.de>
In reply to#8397
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

[toc] | [prev] | [next] | [standalone]


#8401

FromArno Welzel <usenet@arnowelzel.de>
Date2013-02-19 11:51 +0100
Message-ID<51235939.60503@arnowelzel.de>
In reply to#8398
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

[toc] | [prev] | [next] | [standalone]


#8402

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2013-02-19 11:58 +0100
Message-ID<5349567.eTz8zpLT7E@PointedEars.de>
In reply to#8401
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

[toc] | [prev] | [next] | [standalone]


#8403

FromDoug Miller <doug_at_milmac_dot_com@example.com>
Date2013-02-19 12:07 +0000
Message-ID<XnsA16C48A23CA12dougmilmaccom@78.46.70.116>
In reply to#8402
Thomas 'PointedEars' Lahn <PointedEars@web.de> wrote in 
news:5349567.eTz8zpLT7E@PointedEars.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.

[toc] | [prev] | [next] | [standalone]


#8409

FromArno Welzel <usenet@arnowelzel.de>
Date2013-02-20 11:00 +0100
Message-ID<kg26pv$gc2$1@dont-email.me>
In reply to#8402
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

[toc] | [prev] | [next] | [standalone]


#8405

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2013-02-19 12:13 +0000
Message-ID<kfvq9u$9rl$3@news.albasani.net>
In reply to#8401
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.

[toc] | [prev] | [next] | [standalone]


#8410

FromArno Welzel <usenet@arnowelzel.de>
Date2013-02-20 11:01 +0100
Message-ID<kg26rg$gc2$2@dont-email.me>
In reply to#8405
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

[toc] | [prev] | [next] | [standalone]


#8411

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2013-02-20 13:48 +0000
Message-ID<kg2k7t$c30$1@news.albasani.net>
In reply to#8410
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.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web