Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Wikipedia: Wikitech

button action in form problem

 

 

Wikipedia wikitech RSS feed   Index | Next | Previous | View Threaded


sancelot at free

Jul 2, 2009, 2:02 AM

Post #1 of 10 (975 views)
Permalink
button action in form problem

Hi,
I have got an extension with a form and a submit button (mw 1.14)
the problem is when I submit the form button, the search action is performed instead of my function !!

Best Regards
s.ancelot

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


agarrett at wikimedia

Jul 2, 2009, 4:19 AM

Post #2 of 10 (938 views)
Permalink
Re: button action in form problem [In reply to]

On 02/07/2009, at 10:02 AM, sancelot [at] free wrote:

> Hi,
> I have got an extension with a form and a submit button (mw 1.14)
> the problem is when I submit the form button, the search action is
> performed instead of my function !!


You've given shockingly little detail here, but I bet you're sending a
field called 'search'. Try renaming the field.

--
Andrew Garrett
Contract Developer, Wikimedia Foundation
agarrett [at] wikimedia
http://werdn.us




_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


sancelot at free

Jul 2, 2009, 4:22 AM

Post #3 of 10 (937 views)
Permalink
Re: button action in form problem [In reply to]

----- Mail Original -----
De: "Andrew Garrett" <agarrett [at] wikimedia>
À: "Wikimedia developers" <wikitech-l [at] lists>
Envoyé: Jeudi 2 Juillet 2009 13h19:13 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne
Objet: Re: [Wikitech-l] button action in form problem


On 02/07/2009, at 10:02 AM, sancelot [at] free wrote:

> Hi,
> I have got an extension with a form and a submit button (mw 1.14)
> the problem is when I submit the form button, the search action is
> performed instead of my function !!


You've given shockingly little detail here, but I bet you're sending a
field called 'search'. Try renaming the field.

No, I haven't
have a look at the extension code I downloaded here :
http://www.organicdesign.co.nz/Extension:EasyGallery

--
Andrew Garrett
Contract Developer, Wikimedia Foundation
agarrett [at] wikimedia
http://werdn.us




_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


bryan.tongminh at gmail

Jul 2, 2009, 4:32 AM

Post #4 of 10 (936 views)
Permalink
Re: button action in form problem [In reply to]

On Thu, Jul 2, 2009 at 1:22 PM, <sancelot [at] free> wrote:
>
> ----- Mail Original -----
> De: "Andrew Garrett" <agarrett [at] wikimedia>
> À: "Wikimedia developers" <wikitech-l [at] lists>
> Envoyé: Jeudi 2 Juillet 2009 13h19:13 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne
> Objet: Re: [Wikitech-l] button action in form problem
>
>
> On 02/07/2009, at 10:02 AM, sancelot [at] free wrote:
>
>> Hi,
>> I have got an extension with a form and a submit button (mw 1.14)
>> the problem is when I submit the form button, the search action is
>> performed instead of my function !!
>
>
> You've given shockingly little detail here, but I bet you're sending a
> field called 'search'. Try renaming the field.
>
> No, I haven't
> have a look at the extension code I downloaded here :
> http://www.organicdesign.co.nz/Extension:EasyGallery
>
Don't use wfElement, use Xml::openElement. wfElement autocloses.


Bryan

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


agarrett at wikimedia

Jul 2, 2009, 4:34 AM

Post #5 of 10 (932 views)
Permalink
Re: button action in form problem [In reply to]

On 02/07/2009, at 12:22 PM, sancelot [at] free wrote:

> On 02/07/2009, at 10:02 AM, sancelot [at] free wrote:
>
>> Hi,
>> I have got an extension with a form and a submit button (mw 1.14)
>> the problem is when I submit the form button, the search action is
>> performed instead of my function !!
>
>
> > You've given shockingly little detail here, but I bet you're
> sending a
> > field called 'search'. Try renaming the field.
>
> No, I haven't
> have a look at the extension code I downloaded here :
> http://www.organicdesign.co.nz/Extension:EasyGallery


The cause isn't immediately obvious from scanning the code. You should
probably send the actual request that is causing you problems, rather
than expect us to read all of your code and find the bug. At least
point to a test installation where we can try this out.

You should be aware that this extension is vulnerable to a security
exploit called 'cross-site scripting', by putting raw HTML into the
wpParam parameter. See http://en.wikipedia.org/wiki/Cross-
site_scripting for further details.

--
Andrew Garrett
Contract Developer, Wikimedia Foundation
agarrett [at] wikimedia
http://werdn.us




_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


sancelot at free

Jul 2, 2009, 5:53 AM

Post #6 of 10 (934 views)
Permalink
Re: button action in form problem [In reply to]

----- Mail d'origine -----
De: Bryan Tong Minh <bryan.tongminh [at] gmail>
À: Wikimedia developers <wikitech-l [at] lists>
Envoyé: Thu, 2 Jul 2009 13:32:54 +0200 (CEST)
Objet: Re: [Wikitech-l] button action in form problem

On Thu, Jul 2, 2009 at 1:22 PM, <sancelot [at] free> wrote:
>
> ----- Mail Original -----
> De: "Andrew Garrett" <agarrett [at] wikimedia>
> À: "Wikimedia developers" <wikitech-l [at] lists>
> Envoyé: Jeudi 2 Juillet 2009 13h19:13 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne
> Objet: Re: [Wikitech-l] button action in form problem
>
>
> On 02/07/2009, at 10:02 AM, sancelot [at] free wrote:
>
>> Hi,
>> I have got an extension with a form and a submit button (mw 1.14)
>> the problem is when I submit the form button, the search action is
>> performed instead of my function !!
>
>
> You've given shockingly little detail here, but I bet you're sending a
> field called 'search'. Try renaming the field.
>
> No, I haven't
> have a look at the extension code I downloaded here :
> http://www.organicdesign.co.nz/Extension:EasyGallery
>
Don't use wfElement, use Xml::openElement. wfElement autocloses.

I reworked the code to use Xml::openElement Xml::submitButton , ... but the effect is the same
submitting launches search

Bryan

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


innocentkiller at gmail

Jul 2, 2009, 5:59 AM

Post #7 of 10 (939 views)
Permalink
Re: button action in form problem [In reply to]

On Thu, Jul 2, 2009 at 8:53 AM, <sancelot [at] free> wrote:
>
> ----- Mail d'origine -----
> De: Bryan Tong Minh <bryan.tongminh [at] gmail>
> À: Wikimedia developers <wikitech-l [at] lists>
> Envoyé: Thu, 2 Jul 2009 13:32:54 +0200 (CEST)
> Objet: Re: [Wikitech-l] button action in form problem
>
> On Thu, Jul 2, 2009 at 1:22 PM, <sancelot [at] free> wrote:
>>
>> ----- Mail Original -----
>> De: "Andrew Garrett" <agarrett [at] wikimedia>
>> À: "Wikimedia developers" <wikitech-l [at] lists>
>> Envoyé: Jeudi 2 Juillet 2009 13h19:13 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne
>> Objet: Re: [Wikitech-l] button action in form problem
>>
>>
>> On 02/07/2009, at 10:02 AM, sancelot [at] free wrote:
>>
>>> Hi,
>>> I have got an extension with a form and a submit button (mw 1.14)
>>> the problem is when I submit the form button, the search action is
>>> performed instead of my function !!
>>
>>
>> You've given shockingly little detail here, but I bet you're sending a
>> field called 'search'. Try renaming the field.
>>
>> No, I haven't
>> have a look at the extension code I downloaded here :
>> http://www.organicdesign.co.nz/Extension:EasyGallery
>>
> Don't use wfElement, use Xml::openElement. wfElement autocloses.
>
> I reworked the code to use Xml::openElement Xml::submitButton , ... but the effect is the same
> submitting launches search
>
> Bryan
>
> _______________________________________________
> Wikitech-l mailing list
> Wikitech-l [at] lists
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
>
> _______________________________________________
> Wikitech-l mailing list
> Wikitech-l [at] lists
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Are you including a hidden field element set to the title of
the special page?

-Chad

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


sancelot at free

Jul 2, 2009, 6:53 AM

Post #8 of 10 (936 views)
Permalink
Re: button action in form problem [In reply to]

----- Mail Original -----
De: "Chad" <innocentkiller [at] gmail>
À: "Wikimedia developers" <wikitech-l [at] lists>
Envoyé: Jeudi 2 Juillet 2009 14h59:13 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne
Objet: Re: [Wikitech-l] button action in form problem

On Thu, Jul 2, 2009 at 8:53 AM, <sancelot [at] free> wrote:
>
> ----- Mail d'origine -----
> De: Bryan Tong Minh <bryan.tongminh [at] gmail>
> À: Wikimedia developers <wikitech-l [at] lists>
> Envoyé: Thu, 2 Jul 2009 13:32:54 +0200 (CEST)
> Objet: Re: [Wikitech-l] button action in form problem
>
> On Thu, Jul 2, 2009 at 1:22 PM, <sancelot [at] free> wrote:
>>
>> ----- Mail Original -----
>> De: "Andrew Garrett" <agarrett [at] wikimedia>
>> À: "Wikimedia developers" <wikitech-l [at] lists>
>> Envoyé: Jeudi 2 Juillet 2009 13h19:13 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne
>> Objet: Re: [Wikitech-l] button action in form problem
>>
>>
>> On 02/07/2009, at 10:02 AM, sancelot [at] free wrote:
>>
>>> Hi,
>>> I have got an extension with a form and a submit button (mw 1.14)
>>> the problem is when I submit the form button, the search action is
>>> performed instead of my function !!
>>
>>
>> You've given shockingly little detail here, but I bet you're sending a
>> field called 'search'. Try renaming the field.
>>
>> No, I haven't
>> have a look at the extension code I downloaded here :
>> http://www.organicdesign.co.nz/Extension:EasyGallery
>>
> Don't use wfElement, use Xml::openElement. wfElement autocloses.
>
> I reworked the code to use Xml::openElement Xml::submitButton , ... but the effect is the same
> submitting launches search
>
> Bryan
>
> _______________________________________________
> Wikitech-l mailing list
> Wikitech-l [at] lists
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
>
> _______________________________________________
> Wikitech-l mailing list
> Wikitech-l [at] lists
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Are you including a hidden field element set to the title of
the special page?

Yes, but it works the same, either if I use it or not, using a default value .

enclosed is the reworked code.


-Chad

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


ahmad.m.sherif at gmail

Jul 2, 2009, 7:17 AM

Post #9 of 10 (939 views)
Permalink
Re: button action in form problem [In reply to]

Bryan Tong Minh is right, use Xml::openElement instead of wfElement
and you don't have to do the same for the submit button. Only make
sure you close the form with Xml::closeElement, the thing I think you
didn't.

Something like that

$wgOut->addHTML(Xml::closeElement('form'));

before

if ($posted) {

I tested it and it worked.

Ahmad Sherif

On Thu, Jul 2, 2009 at 4:53 PM, <sancelot [at] free> wrote:
>
> ----- Mail Original -----
> De: "Chad" <innocentkiller [at] gmail>
> À: "Wikimedia developers" <wikitech-l [at] lists>
> Envoyé: Jeudi 2 Juillet 2009 14h59:13 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne
> Objet: Re: [Wikitech-l] button action in form problem
>
> On Thu, Jul 2, 2009 at 8:53 AM, <sancelot [at] free> wrote:
> >
> > ----- Mail d'origine -----
> > De: Bryan Tong Minh <bryan.tongminh [at] gmail>
> > À: Wikimedia developers <wikitech-l [at] lists>
> > Envoyé: Thu, 2 Jul 2009 13:32:54 +0200 (CEST)
> > Objet: Re: [Wikitech-l] button action in form problem
> >
> > On Thu, Jul 2, 2009 at 1:22 PM, <sancelot [at] free> wrote:
> >>
> >> ----- Mail Original -----
> >> De: "Andrew Garrett" <agarrett [at] wikimedia>
> >> À: "Wikimedia developers" <wikitech-l [at] lists>
> >> Envoyé: Jeudi 2 Juillet 2009 13h19:13 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne
> >> Objet: Re: [Wikitech-l] button action in form problem
> >>
> >>
> >> On 02/07/2009, at 10:02 AM, sancelot [at] free wrote:
> >>
> >>> Hi,
> >>> I have got an extension with a form and a submit button (mw 1.14)
> >>> the problem is when I submit the form button, the search action is
> >>> performed instead of my function !!
> >>
> >>
> >> You've given shockingly little detail here, but I bet you're sending a
> >> field called 'search'. Try renaming the field.
> >>
> >> No, I haven't
> >> have a look at the extension code I downloaded here :
> >> http://www.organicdesign.co.nz/Extension:EasyGallery
> >>
> > Don't use wfElement, use Xml::openElement. wfElement autocloses.
> >
> > I reworked the code to use Xml::openElement Xml::submitButton , ... but the effect is the same
> > submitting launches search
> >
> > Bryan
> >
> > _______________________________________________
> > Wikitech-l mailing list
> > Wikitech-l [at] lists
> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
> >
> >
> > _______________________________________________
> > Wikitech-l mailing list
> > Wikitech-l [at] lists
> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
> Are you including a hidden field element set to the title of
> the special page?
>
> Yes, but it works the same, either if I use it or not, using a default value  .
>
> enclosed is the reworked code.
>
>
> -Chad
>
> _______________________________________________
> Wikitech-l mailing list
> Wikitech-l [at] lists
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
> _______________________________________________
> Wikitech-l mailing list
> Wikitech-l [at] lists
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


sancelot at free

Jul 2, 2009, 8:05 AM

Post #10 of 10 (933 views)
Permalink
Re: button action in form problem [In reply to]

----- Mail d'origine -----
De: Ahmad Sherif <ahmad.m.sherif [at] gmail>
À: Wikimedia developers <wikitech-l [at] lists>
Envoyé: Thu, 2 Jul 2009 16:17:28 +0200 (CEST)
Objet: Re: [Wikitech-l] button action in form problem

Bryan Tong Minh is right, use Xml::openElement instead of wfElement
and you don't have to do the same for the submit button. Only make
sure you close the form with Xml::closeElement, the thing I think you
didn't.

Something like that

$wgOut->addHTML(Xml::closeElement('form'));

before

if ($posted) {

I tested it and it worked.

You are right ! Thanks a lot


Ahmad Sherif

On Thu, Jul 2, 2009 at 4:53 PM, <sancelot [at] free> wrote:
>
> ----- Mail Original -----
> De: "Chad" <innocentkiller [at] gmail>
> À: "Wikimedia developers" <wikitech-l [at] lists>
> Envoyé: Jeudi 2 Juillet 2009 14h59:13 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne
> Objet: Re: [Wikitech-l] button action in form problem
>
> On Thu, Jul 2, 2009 at 8:53 AM, <sancelot [at] free> wrote:
> >
> > ----- Mail d'origine -----
> > De: Bryan Tong Minh <bryan.tongminh [at] gmail>
> > À: Wikimedia developers <wikitech-l [at] lists>
> > Envoyé: Thu, 2 Jul 2009 13:32:54 +0200 (CEST)
> > Objet: Re: [Wikitech-l] button action in form problem
> >
> > On Thu, Jul 2, 2009 at 1:22 PM, <sancelot [at] free> wrote:
> >>
> >> ----- Mail Original -----
> >> De: "Andrew Garrett" <agarrett [at] wikimedia>
> >> À: "Wikimedia developers" <wikitech-l [at] lists>
> >> Envoyé: Jeudi 2 Juillet 2009 13h19:13 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne
> >> Objet: Re: [Wikitech-l] button action in form problem
> >>
> >>
> >> On 02/07/2009, at 10:02 AM, sancelot [at] free wrote:
> >>
> >>> Hi,
> >>> I have got an extension with a form and a submit button (mw 1.14)
> >>> the problem is when I submit the form button, the search action is
> >>> performed instead of my function !!
> >>
> >>
> >> You've given shockingly little detail here, but I bet you're sending a
> >> field called 'search'. Try renaming the field.
> >>
> >> No, I haven't
> >> have a look at the extension code I downloaded here :
> >> http://www.organicdesign.co.nz/Extension:EasyGallery
> >>
> > Don't use wfElement, use Xml::openElement. wfElement autocloses.
> >
> > I reworked the code to use Xml::openElement Xml::submitButton , ... but the effect is the same
> > submitting launches search
> >
> > Bryan
> >
> > _______________________________________________
> > Wikitech-l mailing list
> > Wikitech-l [at] lists
> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
> >
> >
> > _______________________________________________
> > Wikitech-l mailing list
> > Wikitech-l [at] lists
> > https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
> Are you including a hidden field element set to the title of
> the special page?
>
> Yes, but it works the same, either if I use it or not, using a default value  .
>
> enclosed is the reworked code.
>
>
> -Chad
>
> _______________________________________________
> Wikitech-l mailing list
> Wikitech-l [at] lists
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
> _______________________________________________
> Wikitech-l mailing list
> Wikitech-l [at] lists
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l

_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


_______________________________________________
Wikitech-l mailing list
Wikitech-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Wikipedia wikitech RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.