473,385 Members | 1,553 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Forcing OnClick

Hi!

When I have a checkbox, which migth be set in JS, then I'd like to
trigger the OnClick event on that if possible.

Like:

v.elements[i].checked= !v.elements[i].checked;
//here - force the onclik on that

How do I do that?

Sonnich

Jan 4 '07 #1
4 1370

Sonnich wrote:
Hi!

When I have a checkbox, which migth be set in JS, then I'd like to
trigger the OnClick event on that if possible.

Like:

v.elements[i].checked= !v.elements[i].checked;
//here - force the onclik on that

How do I do that?
And - when talking of this. Is there a way, just have an OnClick on
some text, without href="#", which makes it scroll to top?

BR
Sonnich

Jan 4 '07 #2
Sonnich wrote on 04 jan 2007 in comp.lang.javascript:
>
Sonnich wrote:
>Hi!

When I have a checkbox, which migth be set in JS, then I'd like to
trigger the OnClick event on that if possible.

Like:

v.elements[i].checked= !v.elements[i].checked;
//here - force the onclik on that

How do I do that?

And - when talking of this. Is there a way, just have an OnClick on
some text, without href="#", which makes it scroll to top?
You would have to click an element, like <span>.

onclick='window.scrollTo(0,0);'

<http://www.w3schools.com/htmldom/met_win_scrollto.asp>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jan 4 '07 #3

Evertjan. wrote:
Sonnich wrote on 04 jan 2007 in comp.lang.javascript:

Sonnich wrote:
Hi!

When I have a checkbox, which migth be set in JS, then I'd like to
trigger the OnClick event on that if possible.

Like:

v.elements[i].checked= !v.elements[i].checked;
//here - force the onclik on that

How do I do that?
And - when talking of this. Is there a way, just have an OnClick on
some text, without href="#", which makes it scroll to top?

You would have to click an element, like <span>.
Would anyone explain a bit here...?
I dont know what to look for, and <spanwill probably result in
476547365 results...
>
onclick='window.scrollTo(0,0);'

<http://www.w3schools.com/htmldom/met_win_scrollto.asp>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jan 12 '07 #4
jodleren wrote on 12 jan 2007 in comp.lang.javascript:
>You would have to click an element, like <span>.

Would anyone explain a bit here...?
I dont know what to look for, and <spanwill probably result in
476547365 results...
"probably"?

So you did not even try?

Before putting your hands on clientside jvascript,
it seems sensible to know the basics of html.

Try: <http://www.w3schools.com/html/>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jan 12 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: James Howe | last post by:
I have a page which has a small number of input fields and some areas on the screen where the user can click to make things happen. These areas are generally <span>s with some associated onclick...
1
by: ehm | last post by:
I apologize in advance for the cross-post (from microsoft.public.inetexplorer.scripting), but that board seems dead. I have what I think is a fairly simple problem, but I cannot figure this out....
40
by: Neo The One | last post by:
I think C# is forcing us to write more code by enforcing a rule that can be summarized as 'A local variable must be assgined *explicitly* before reading its value.' If you are interested in what...
6
by: G Dean Blake | last post by:
in my aspx app I am writing a stream that works fine but it replaces what is in the client browser window. The code is as follows: .. .. HttpContext.Current.Response.ClearHeaders()...
6
by: SkeanDu | last post by:
Ok, here is my problem. I have an aspx page that displays a databound datagrid and in one of the datagrid column headers I have an image that when clicked opens up a modal web dialog (another...
2
by: Sonnich | last post by:
Hi all! Probably simple - once one knows. I have a window, which open using <input type="button" class="box" name="main" value=" Add... " onClick=window.open('add.asp')> The window has...
4
by: ATS16805 | last post by:
Hi. I wonder if it's possible to "force" a browser to "switch to SSR mode" for any given document. Specifically, I'm looking for a solution, not to a User Agent issue (i think), but a coding idea;...
1
by: Kevin | last post by:
I am trying to get a combo box to automatically dropdown. I have tried using both me.cboComboName.Dropdown and SendKeys "{F4}" in the OnEnter, OnGotFocus and OnClick events and none seem to...
2
by: xtian | last post by:
Hi, I have been having some trouble with getting a column to be a fixed width. I have a table with 11 columns, so it doesn't all fit in a normal browser window. One of the cells has a "?" and then...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.