[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.javascript

Onclick event doesnt work in webkit browser

Poonam Sachdeva

8/15/2014 9:45:00 PM

I am trying to change my GUI on onclick. It works fine in google chrome and firefox but doesnt work in webkit browser. Tried to debug but it doesnt go into the function only. Have tried using addEventListeners but it doesnt work as well. it doesnt trigger the onclick.

<select name="MetricType" id="MetricType" onclick="UpdateMetricFromGUI();">
<option value=CDatHT >CD</option>
<option value=HT >HT</option>
<option value=BowCD >BowCD</option>
<option value=NeckCD >NeckCD</option>
</select>


function UpdateMetricFromGUI() {
if (m_oSetup === null) {
msgBox("Please create a recipe first.");
}
else if (m_oSetup.Metrics !== null && m_oSetup.Metrics.length > 0) {

var l_oMetric = m_oSetup.Metrics[m_iCurrentMetricIndex];

l_oMetric.Category = document.getElementById("MetricType").value;
l_oMetric.PitchSampling = document.getElementById('ZoneSampling').selectedIndex + 1;
UpdateBoxesFromSetup(m_oSetup);
}
}
29 Answers

Steve Yandl

7/29/2009 1:32:00 PM

0

I'm not certain but think you might have to insert a
DoEvents
statement.


Steve



"kirkm" <xyz@xyz.com.invalid> wrote in message
news:barv65lfmvga1mfvdug7r4e9ifvu5c8nq7@4ax.com...
> On Tue, 28 Jul 2009 12:29:34 -0700, "Steve Yandl" <syandl@comcast.net>
> wrote:
>
>>Kirk,
>>
>>I did a quick test and your code worked fine except a width of 30 wasn't
>>quite enough to fit the caption. The one think I left out was the
>>variable
>>declaration. Try changing
>>Dim myLabel As Label
>>to
>>Dim myLabel As Control
>>
>>
>>Steve Yandl
>
> Steve, thanks for that. Worked a treat.
> But do you know how (or if you can)
> lock the controls onto the Forn, as if they had been
> put there at design time?
>
> I've found I can't get to their click event code anyhow.
>
> Thanks - Kirk

Evertjan.

8/15/2014 10:16:00 PM

0

PS <poonam.sachdeva5@gmail.com> wrote on 15 aug 2014 in
comp.lang.javascript:

> I am trying to change my GUI on onclick. It works fine in google chrome
> and firefox but doesnt work in webkit browser. Tried to debug but it
> doesnt go into the function only.

Is Chrome not a webkit browser?

> Have tried using addEventListeners but
> it doesnt work as well. it doesnt trigger the onclick.

Try:

object.onclick = function(){alert(this.value);};

> <select name="MetricType" id="MetricType"
> onclick="UpdateMetricFromGUI();">
> <option value=CDatHT >CD</option>
> <option value=HT >HT</option>
> <option value=BowCD >BowCD</option>
> <option value=NeckCD >NeckCD</option>
> </select>

Why not go back to the bare code when asking a Q?
The extra code you showed only complicates the issue.

Try:

<select onclick='alert(this.value);'>
<option value='1 selected' >One</option>
<option value='2 selected' >Two</option>
</select>



--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Poonam Sachdeva

8/15/2014 10:22:00 PM

0


Doesnt work in webkit.
Works in FF.

On Friday, August 15, 2014 3:15:33 PM UTC-7, Evertjan. wrote:
> PS <poonam.sachdeva5@gmail.com> wrote on 15 aug 2014 in
>
> comp.lang.javascript:
>
>
>
> > I am trying to change my GUI on onclick. It works fine in google chrome
>
> > and firefox but doesnt work in webkit browser. Tried to debug but it
>
> > doesnt go into the function only.
>
>
>
> Is Chrome not a webkit browser?
>
>
>
> > Have tried using addEventListeners but
>
> > it doesnt work as well. it doesnt trigger the onclick.
>
>
>
> Try:
>
>
>
> object.onclick = function(){alert(this.value);};
>
>
>
> > <select name="MetricType" id="MetricType"
>
> > onclick="UpdateMetricFromGUI();">
>
> > <option value=CDatHT >CD</option>
>
> > <option value=HT >HT</option>
>
> > <option value=BowCD >BowCD</option>
>
> > <option value=NeckCD >NeckCD</option>
>
> > </select>
>
>
>
> Why not go back to the bare code when asking a Q?
>
> The extra code you showed only complicates the issue.
>
>
>
> Try:
>
>
>
> <select onclick='alert(this.value);'>
>
> <option value='1 selected' >One</option>
>
> <option value='2 selected' >Two</option>
>
> </select>
>
>
>
>
>
>
>
> --
>
> Evertjan.
>
> The Netherlands.
>
> (Please change the x'es to dots in my emailaddress)

Evertjan.

8/15/2014 10:41:00 PM

0

PS <poonam.sachdeva5@gmail.com> wrote on 16 aug 2014 in
comp.lang.javascript:

> Doesnt work in webkit.
> Works in FF.

Please do not toppost,
as [that way?] you forget to answer my pertinent Q.

My code works fine in Chrome, which is Webkit.

My code also works fine in Chrome Mobile, which is Webkit.

So what browser do you mean that does not work?
What do you mean by "Doesnt work" exactly, btw?

>
> On Friday, August 15, 2014 3:15:33 PM UTC-7, Evertjan. wrote:
>> PS <poonam.sachdeva5@gmail.com> wrote on 15 aug 2014 in
>>
>> comp.lang.javascript:
>>
>> > I am trying to change my GUI on onclick. It works fine in google chrome
>> > and firefox but doesnt work in webkit browser. Tried to debug but it
>> > doesnt go into the function only.
>>
>> Is Chrome not a webkit browser?
>>
>> > Have tried using addEventListeners but
>> > it doesnt work as well. it doesnt trigger the onclick.
>>
>> Try:
>>
>> object.onclick = function(){alert(this.value);};
>>
>> > <select name="MetricType" id="MetricType"
>> > onclick="UpdateMetricFromGUI();">
>> > <option value=CDatHT >CD</option>
>> > <option value=HT >HT</option>
>> > <option value=BowCD >BowCD</option>
>> > <option value=NeckCD >NeckCD</option>
>> > </select>
>>
>> Why not go back to the bare code when asking a Q?
>> The extra code you showed only complicates the issue.
>>
>> Try:
>>
>> <select onclick='alert(this.value);'>
>> <option value='1 selected' >One</option>
>> <option value='2 selected' >Two</option>
>> </select>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Poonam Sachdeva

8/15/2014 10:44:00 PM

0

I have my own browser which is webkit as well. the code doesnt work in that one.

On Friday, August 15, 2014 3:40:30 PM UTC-7, Evertjan. wrote:
> PS <poonam.sachdeva5@gmail.com> wrote on 16 aug 2014 in
>
> comp.lang.javascript:
>
>
>
> > Doesnt work in webkit.
>
> > Works in FF.
>
>
>
> Please do not toppost,
>
> as [that way?] you forget to answer my pertinent Q.
>
>
>
> My code works fine in Chrome, which is Webkit.
>
>
>
> My code also works fine in Chrome Mobile, which is Webkit.
>
>
>
> So what browser do you mean that does not work?
>
> What do you mean by "Doesnt work" exactly, btw?
>
>
>
> >
>
> > On Friday, August 15, 2014 3:15:33 PM UTC-7, Evertjan. wrote:
>
> >> PS <poonam.sachdeva5@gmail.com> wrote on 15 aug 2014 in
>
> >>
>
> >> comp.lang.javascript:
>
> >>
>
> >> > I am trying to change my GUI on onclick. It works fine in google chrome
>
> >> > and firefox but doesnt work in webkit browser. Tried to debug but it
>
> >> > doesnt go into the function only.
>
> >>
>
> >> Is Chrome not a webkit browser?
>
> >>
>
> >> > Have tried using addEventListeners but
>
> >> > it doesnt work as well. it doesnt trigger the onclick.
>
> >>
>
> >> Try:
>
> >>
>
> >> object.onclick = function(){alert(this.value);};
>
> >>
>
> >> > <select name="MetricType" id="MetricType"
>
> >> > onclick="UpdateMetricFromGUI();">
>
> >> > <option value=CDatHT >CD</option>
>
> >> > <option value=HT >HT</option>
>
> >> > <option value=BowCD >BowCD</option>
>
> >> > <option value=NeckCD >NeckCD</option>
>
> >> > </select>
>
> >>
>
> >> Why not go back to the bare code when asking a Q?
>
> >> The extra code you showed only complicates the issue.
>
> >>
>
> >> Try:
>
> >>
>
> >> <select onclick='alert(this.value);'>
>
> >> <option value='1 selected' >One</option>
>
> >> <option value='2 selected' >Two</option>
>
> >> </select>
>
>
>
> --
>
> Evertjan.
>
> The Netherlands.
>
> (Please change the x'es to dots in my emailaddress)

Poonam Sachdeva

8/15/2014 10:56:00 PM

0

On Friday, August 15, 2014 3:43:35 PM UTC-7, PS wrote:
> I have my own browser which is webkit as well. the code doesnt work in that one.
>
>
>
> On Friday, August 15, 2014 3:40:30 PM UTC-7, Evertjan. wrote:
>
> > PS <poonam.sachdeva5@gmail.com> wrote on 16 aug 2014 in
>
> >
>
> > comp.lang.javascript:
>
> >
>
> >
>
> >
>
> > > Doesnt work in webkit.
>
> >
>
> > > Works in FF.
>
> >
>
> >
>
> >
>
> > Please do not toppost,
>
> >
>
> > as [that way?] you forget to answer my pertinent Q.
>
> >
>
> >
>
> >
>
> > My code works fine in Chrome, which is Webkit.
>
> >
>
> >
>
> >
>
> > My code also works fine in Chrome Mobile, which is Webkit.
>
> >
>
> >
>
> >
>
> > So what browser do you mean that does not work?
>
> >
>
> > What do you mean by "Doesnt work" exactly, btw?
>
> >
>
> >
>
> >
>
> > >
>
> >
>
> > > On Friday, August 15, 2014 3:15:33 PM UTC-7, Evertjan. wrote:
>
> >
>
> > >> PS <poonam.sachdeva5@gmail.com> wrote on 15 aug 2014 in
>
> >
>
> > >>
>
> >
>
> > >> comp.lang.javascript:
>
> >
>
> > >>
>
> >
>
> > >> > I am trying to change my GUI on onclick. It works fine in google chrome
>
> >
>
> > >> > and firefox but doesnt work in webkit browser. Tried to debug but it
>
> >
>
> > >> > doesnt go into the function only.
>
> >
>
> > >>
>
> >
>
> > >> Is Chrome not a webkit browser?
>
> >
>
> > >>
>
> >
>
> > >> > Have tried using addEventListeners but
>
> >
>
> > >> > it doesnt work as well. it doesnt trigger the onclick.
>
> >
>
> > >>
>
> >
>
> > >> Try:
>
> >
>
> > >>
>
> >
>
> > >> object.onclick = function(){alert(this.value);};
>
> >
>
> > >>
>
> >
>
> > >> > <select name="MetricType" id="MetricType"
>
> >
>
> > >> > onclick="UpdateMetricFromGUI();">
>
> >
>
> > >> > <option value=CDatHT >CD</option>
>
> >
>
> > >> > <option value=HT >HT</option>
>
> >
>
> > >> > <option value=BowCD >BowCD</option>
>
> >
>
> > >> > <option value=NeckCD >NeckCD</option>
>
> >
>
> > >> > </select>
>
> >
>
> > >>
>
> >
>
> > >> Why not go back to the bare code when asking a Q?
>
> >
>
> > >> The extra code you showed only complicates the issue.
>
> >
>
> > >>
>
> >
>
> > >> Try:
>
> >
>
> > >>
>
> >
>
> > >> <select onclick='alert(this.value);'>
>
> >
>
> > >> <option value='1 selected' >One</option>
>
> >
>
> > >> <option value='2 selected' >Two</option>
>
> >
>
> > >> </select>
>
> >
>
> >
>
> >
>
> > --
>

Evertjan,

Is there any different way of executing a function when I change the items in dropdown instead of Onclick, onchange or AddEventListener


> >
>
> > Evertjan.
>
> >
>
> > The Netherlands.
>
> >
>
> > (Please change the x'es to dots in my emailaddress)

Christoph M. Becker

8/15/2014 11:18:00 PM

0

PS wrote:

> I am trying to change my GUI on onclick. It works fine in google
> chrome and firefox but doesnt work in webkit browser. Tried to debug
> but it doesnt go into the function only. Have tried using
> addEventListeners but it doesnt work as well. it doesnt trigger the
> onclick.
>
> <select name="MetricType" id="MetricType" onclick="UpdateMetricFromGUI();">

Use "onchange" instead of "onclick".

And please read and heed the Newsgroup's rules regarding posting[1].

[1] <http://pointedears.de/scripts/faq/cljs/notes/po...

--
Christoph M. Becker

Christoph M. Becker

8/15/2014 11:21:00 PM

0

Evertjan. wrote:

> Is Chrome not a webkit browser?

Since version 28 (more than a year ago) Chrome uses the Blink engine,
which is a fork of Webkit[1].

[1] <http://en.wikipedia.org/wiki/Google_...

--
Christoph M. Becker

Poonam Sachdeva

8/15/2014 11:37:00 PM

0

I tried with onchange it doesnt work as well,
Its strange as usually browser behaves the same as google chrome(both are webkit) but this time the code is working on chrome but not on my browser.


On Friday, August 15, 2014 4:21:01 PM UTC-7, Christoph M. Becker wrote:
> Evertjan. wrote:
>
>
>
> > Is Chrome not a webkit browser?
>
>
>
> Since version 28 (more than a year ago) Chrome uses the Blink engine,
>
> which is a fork of Webkit[1].
>
>
>
> [1] <http://en.wikipedia.org/wiki/Google_...
>
>
>
> --
>
> Christoph M. Becker

Christoph M. Becker

8/16/2014 12:10:00 AM

0

PS wrote:

> I tried with onchange it doesnt work as well,
> Its strange as usually browser behaves the same as google chrome(both
> are webkit)

Google Chrome uses Blink, which is a fork of Webkit, as I already noted.
I don't know which layout engine is used by "your own browser".

> but this time the code is working on chrome but not on my
> browser.

Maybe your browser is broken or you have to enable JavaScript. It might
be useful to tell which browser you are using.

And because you might have missed it, because you are using the worst
interface to Usenet, namely Google Groups: please read and heed the
newsgroup's rules regarding posting:
<http://pointedears.de/scripts/faq/cljs/notes/po....

--
Christoph M. Becker