I have a check box on my page. When a user clicks this box I have a
confirmation box come up.
When the user clicks OK, true is returned, otherwise false.
Now, when true is Returened, I want the form to postback. I can't figure
out how to do this.
Here is the code I use to put the OnClick event on the CHeckbox.
this.chkClosed.Attributes.Add("onClick","return CheckClosed('" +
chkClosed.ID + "');");
It works fine. However, it will not fire a postback.
The Source shows this:
<input id="chkClosed" type="checkbox" name="chkClosed" onclick="return
CheckClosed('chkClosed');__doPostBack('chkClosed', '')" language="javascript"
/>
ANy advice? 7 5452
Ryan,
If you function is returning true the postback should certainly fire. May we
see your CheckClosed javascript? The problem must lie there.
--
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer www.aboutfortunate.com
"Out of chaos comes order."
Nietzsche
"Ryan Ternier" <rt******@icompasstech.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl... I have a check box on my page. When a user clicks this box I have a confirmation box come up.
When the user clicks OK, true is returned, otherwise false.
Now, when true is Returened, I want the form to postback. I can't figure out how to do this.
Here is the code I use to put the OnClick event on the CHeckbox.
this.chkClosed.Attributes.Add("onClick","return CheckClosed('" + chkClosed.ID + "');");
It works fine. However, it will not fire a postback.
The Source shows this:
<input id="chkClosed" type="checkbox" name="chkClosed" onclick="return CheckClosed('chkClosed');__doPostBack('chkClosed', '')" language="javascript" />
ANy advice?
function CheckClosed(checkbox)
{
...var chkBox = document.getElementById(checkbox);
...if(chkBox.checked == true)
...{
.....if(confirm("Changing this Package to Closed will cause all Items within
the Package to be closed.\n Press Ok to Continue."))
........return true;
.....else
........return false;
.....}
...else
...return true;
}
The ConfimationBox pops up correctly, and works fine. It just doesn't
postback. I even hardcoded a "Return true;" at the top of the function and
it didn't fire.
/RT
"S. Justin Gengo" <justin@[no_spam_please]aboutfortunate.com> wrote in
message news:Oi**************@tk2msftngp13.phx.gbl... Ryan,
If you function is returning true the postback should certainly fire. May we see your CheckClosed javascript? The problem must lie there.
-- Sincerely,
S. Justin Gengo, MCP Web Developer / Programmer
www.aboutfortunate.com
"Out of chaos comes order." Nietzsche "Ryan Ternier" <rt******@icompasstech.com> wrote in message news:%2****************@tk2msftngp13.phx.gbl...I have a check box on my page. When a user clicks this box I have a confirmation box come up.
When the user clicks OK, true is returned, otherwise false.
Now, when true is Returened, I want the form to postback. I can't figure out how to do this.
Here is the code I use to put the OnClick event on the CHeckbox.
this.chkClosed.Attributes.Add("onClick","return CheckClosed('" + chkClosed.ID + "');");
It works fine. However, it will not fire a postback.
The Source shows this:
<input id="chkClosed" type="checkbox" name="chkClosed" onclick="return CheckClosed('chkClosed');__doPostBack('chkClosed', '')" language="javascript" />
ANy advice?
Ryan,
Funny, I sure don't see anything wrong with your code. And placing a return
true at the top of the function is what I would have suggested next. Just to
get an exact description of the behaviour, the page does not post back at
all, or it posts back but the checkbox's event doesn't fire?
--
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer www.aboutfortunate.com
"Out of chaos comes order."
Nietzsche
"Ryan Ternier" <rt******@icompasstech.com> wrote in message
news:uF**************@TK2MSFTNGP12.phx.gbl... function CheckClosed(checkbox) { ..var chkBox = document.getElementById(checkbox); ..if(chkBox.checked == true) ..{ ....if(confirm("Changing this Package to Closed will cause all Items within the Package to be closed.\n Press Ok to Continue.")) .......return true; ....else .......return false; ....} ..else ..return true; }
The ConfimationBox pops up correctly, and works fine. It just doesn't postback. I even hardcoded a "Return true;" at the top of the function and it didn't fire.
/RT "S. Justin Gengo" <justin@[no_spam_please]aboutfortunate.com> wrote in message news:Oi**************@tk2msftngp13.phx.gbl... Ryan,
If you function is returning true the postback should certainly fire. May we see your CheckClosed javascript? The problem must lie there.
-- Sincerely,
S. Justin Gengo, MCP Web Developer / Programmer
www.aboutfortunate.com
"Out of chaos comes order." Nietzsche "Ryan Ternier" <rt******@icompasstech.com> wrote in message news:%2****************@tk2msftngp13.phx.gbl...I have a check box on my page. When a user clicks this box I have a confirmation box come up.
When the user clicks OK, true is returned, otherwise false.
Now, when true is Returened, I want the form to postback. I can't figure out how to do this.
Here is the code I use to put the OnClick event on the CHeckbox.
this.chkClosed.Attributes.Add("onClick","return CheckClosed('" + chkClosed.ID + "');");
It works fine. However, it will not fire a postback.
The Source shows this:
<input id="chkClosed" type="checkbox" name="chkClosed" onclick="return CheckClosed('chkClosed');__doPostBack('chkClosed', '')" language="javascript" />
ANy advice?
you only want to return if the user click no, otherwise you want to run the
next statement. try:
chkClosed.Attributes.Add("onClick","if (!CheckClosed('" +
chkClosed.ClientID + "') return;");
-- bruce (sqlwork.com)
"Ryan Ternier" <rt******@icompasstech.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl... I have a check box on my page. When a user clicks this box I have a confirmation box come up.
When the user clicks OK, true is returned, otherwise false.
Now, when true is Returened, I want the form to postback. I can't figure out how to do this.
Here is the code I use to put the OnClick event on the CHeckbox.
this.chkClosed.Attributes.Add("onClick","return CheckClosed('" + chkClosed.ID + "');");
It works fine. However, it will not fire a postback.
The Source shows this:
<input id="chkClosed" type="checkbox" name="chkClosed" onclick="return CheckClosed('chkClosed');__doPostBack('chkClosed', '')" language="javascript" />
ANy advice?
That did it!
Why did this work and not the previous statement I had?
My code worked on a submit button, but not a CheckBox... hmm
Thanks for the help man!
/RT
"Bruce Barker" <br******************@safeco.com> wrote in message
news:ed**************@TK2MSFTNGP10.phx.gbl... you only want to return if the user click no, otherwise you want to run the next statement. try:
chkClosed.Attributes.Add("onClick","if (!CheckClosed('" + chkClosed.ClientID + "') return;");
-- bruce (sqlwork.com)
"Ryan Ternier" <rt******@icompasstech.com> wrote in message news:%2****************@tk2msftngp13.phx.gbl...I have a check box on my page. When a user clicks this box I have a confirmation box come up.
When the user clicks OK, true is returned, otherwise false.
Now, when true is Returened, I want the form to postback. I can't figure out how to do this.
Here is the code I use to put the OnClick event on the CHeckbox.
this.chkClosed.Attributes.Add("onClick","return CheckClosed('" + chkClosed.ID + "');");
It works fine. However, it will not fire a postback.
The Source shows this:
<input id="chkClosed" type="checkbox" name="chkClosed" onclick="return CheckClosed('chkClosed');__doPostBack('chkClosed', '')" language="javascript" />
ANy advice?
a submit button posts automatically, you cancel in client script by
returning a false on the onclick event. asp.net controls like a checkbox
postback by calling a function __doPostback(), which in turn calls
form.submit(); so with the checkbox you only excute a return to cancel the
postback, but with a submit you return the value true or false to control
the cancel.
-- bruce (sqlwork.com)
"Ryan Ternier" <rt******@icompasstech.com> wrote in message
news:Or**************@TK2MSFTNGP15.phx.gbl... That did it!
Why did this work and not the previous statement I had?
My code worked on a submit button, but not a CheckBox... hmm
Thanks for the help man!
/RT "Bruce Barker" <br******************@safeco.com> wrote in message news:ed**************@TK2MSFTNGP10.phx.gbl... you only want to return if the user click no, otherwise you want to run the next statement. try:
chkClosed.Attributes.Add("onClick","if (!CheckClosed('" + chkClosed.ClientID + "') return;");
-- bruce (sqlwork.com)
"Ryan Ternier" <rt******@icompasstech.com> wrote in message news:%2****************@tk2msftngp13.phx.gbl...I have a check box on my page. When a user clicks this box I have a confirmation box come up.
When the user clicks OK, true is returned, otherwise false.
Now, when true is Returened, I want the form to postback. I can't figure out how to do this.
Here is the code I use to put the OnClick event on the CHeckbox.
this.chkClosed.Attributes.Add("onClick","return CheckClosed('" + chkClosed.ID + "');");
It works fine. However, it will not fire a postback.
The Source shows this:
<input id="chkClosed" type="checkbox" name="chkClosed" onclick="return CheckClosed('chkClosed');__doPostBack('chkClosed', '')" language="javascript" />
ANy advice?
Bruce,
Great information. Thanks!
--
Sincerely,
S. Justin Gengo, MCP
Web Developer / Programmer www.aboutfortunate.com
"Out of chaos comes order."
Nietzsche
"Bruce Barker" <br******************@safeco.com> wrote in message
news:Oh**************@TK2MSFTNGP14.phx.gbl... a submit button posts automatically, you cancel in client script by returning a false on the onclick event. asp.net controls like a checkbox postback by calling a function __doPostback(), which in turn calls form.submit(); so with the checkbox you only excute a return to cancel the postback, but with a submit you return the value true or false to control the cancel.
-- bruce (sqlwork.com)
"Ryan Ternier" <rt******@icompasstech.com> wrote in message news:Or**************@TK2MSFTNGP15.phx.gbl... That did it!
Why did this work and not the previous statement I had?
My code worked on a submit button, but not a CheckBox... hmm
Thanks for the help man!
/RT "Bruce Barker" <br******************@safeco.com> wrote in message news:ed**************@TK2MSFTNGP10.phx.gbl... you only want to return if the user click no, otherwise you want to run the next statement. try:
chkClosed.Attributes.Add("onClick","if (!CheckClosed('" + chkClosed.ClientID + "') return;");
-- bruce (sqlwork.com)
"Ryan Ternier" <rt******@icompasstech.com> wrote in message news:%2****************@tk2msftngp13.phx.gbl... I have a check box on my page. When a user clicks this box I have a confirmation box come up.
When the user clicks OK, true is returned, otherwise false.
Now, when true is Returened, I want the form to postback. I can't figure out how to do this.
Here is the code I use to put the OnClick event on the CHeckbox.
this.chkClosed.Attributes.Add("onClick","return CheckClosed('" + chkClosed.ID + "');");
It works fine. However, it will not fire a postback.
The Source shows this:
<input id="chkClosed" type="checkbox" name="chkClosed" onclick="return CheckClosed('chkClosed');__doPostBack('chkClosed', '')" language="javascript" />
ANy advice?
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Homa |
last post by:
Hi,
I have a Datagrid that uses as a shopping cart and have a checkbox
template column in it. I can't add both OnCheckedChanged Event and
onclick client script for it.
I want to do two...
|
by: Leo J. Hart IV |
last post by:
Hello,
I'm hoping someone can help me out.
I was wondering if the Enabled property of a CheckBox or RadioButton
server control is stored in the ViewState. If not, is there some way
to to add...
|
by: DotNetJunkies User |
last post by:
1.
i want to populate checkboxlist using javascript only at client side ....how can i do this..by populate word i mean that checkboxes should be checked or unchecked on some condition basis.......
|
by: Nathan |
last post by:
I have an aspx page with a data grid, some textboxes, and an update button.
This page also has one html input element with type=file (not inside the data
grid and runat=server).
The update...
|
by: Javier |
last post by:
Hi Everyone,
I have a dynamic checkbox in a datagrid that uses the ITemplate interface
and has the checkchanged event wired up. When the checkbox is checked, the
event
event handler that...
| |
by: |
last post by:
I have a checkbox on a web page. When it is checked, I want a Table to appear (or disappear when the checkbox is cleared)... I was hoping to use client side code for this, so I created a short...
|
by: dave |
last post by:
I have a html table and mutliple rows. On each row i put an onclick event
that opesn a modal window and prompts the user for some information.
I want this modal window to show when the user...
|
by: rn5a |
last post by:
All the rows in a DataGrid, including the Header, are accompanied with
a CheckBox. I want that when the CheckBox in the Header is checked,
then all the CheckBoxes should automatically get checked....
|
by: sydneycan |
last post by:
Hi everyone. First time I'm posting something, so far I've been able to google it out but this time no luck so far...
I have a html input checkbox on my page
From the javascript 'switchlayers' in...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| | |