473,398 Members | 2,812 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,398 software developers and data experts.

PostBack behaviour in IE vs. FF

Is there a term for an individual who is half way between a Newby and a Novice?

Anyway, getting down to business...

I am trying to develop an on-line application form for my company's website. In it I have a number of 'Yes/No' or 'Select This Option' type questions where if an option is checked it will disable/enable another. I ended up using ClientScriptBlocks of JavaScript to accomplish this behaviour instead of an ASP.NET solution. Something like:
function Q8OngoingClicked(source)
{
//disable end date selections if ongoing is checked
var oMonth = document.getElementById('lstQ8EndMonth');
var oDate = document.getElementById('lstQ8EndDate');
var oYear = document.getElementById('lstQ8EndYear');
if (source.checked)
{
oMonth.disabled = true;
oDate.disabled = true;
oYear.disabled = true;
}
else
{
oMonth.disabled = false;
oDate.disabled = false;
oYear.disabled = false;
}
}<body><input id="chkQ8Ongoing" type="checkbox" name="chkQ8Ongoing" onclick="Q8OngoingClicked(this)" /></body> Now, this works fine (tested with IE6 and FF1.0.6). However, I have added a subroutine that checks each of the responses to see if they are valid before it submits to our database. It states something like, "Question X had an invalid response. Please press your back button to make corrections and re-submit." As some of the gurus of the group can guess when I test the form and press the back button those items that were once disabled are now enabled even if the first item (chkQ8Ongoing in the example above) is checked.

So, I tried an ASP.NET (VB.NET Framework 1.1) approach where I have a function like:

Private Sub Page_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
If Me.IsPostBack Then
ReLoad()
End If
End Sub
....
Private Sub ReLoad()
If chkQ8Ongoing.Checked Then
lstQ8EndMonth.Enabled = False
...
Else
...
End If
End Sub

But this just ends up with an "Reference not set to an instance of an object" error condition. Then I went back to using StarupScript of JavaScript again like:

chkQ8Ongoing = document.getElementById('chkQ8Ongoing');
lstQ8EndMonth = document.getElementById('lstQ8EndMonth');
lstQ8EndDate = document.getElementById('lstQ8EndDate');
lstQ8EndYear = document.getElementById('lstQ8EndYear');
if (chkQ8Ongoing.checked)
{
lstQ8EndMonth.disabled = true;
lstQ8EndDate.disabled = true;
lstQ8EndYear.disabled = true;
}
else
{
lstQ8EndMonth.disabled = false;
lstQ8EndDate.disabled = false;
lstQ8EndYear.disabled = false;
}This works to disable items using Firefox but doesn't work in IE and I don't know why.

What am I missing?
Is there a way to do this purely in ASP.NET?
TIA...
Nov 19 '05 #1
2 1520
A Nobice? :-)

I just found this [1] today and it may help you out.

<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/

"Ferret Face" <ff***@msn.com> wrote in message news:f5********************@giganews.com...
Is there a term for an individual who is half way between a Newby and a Novice?

Anyway, getting down to business...

I am trying to develop an on-line application form for my company's website. In it I have a number of 'Yes/No' or 'Select This Option' type questions where if an option is checked it will disable/enable another. I ended up using ClientScriptBlocks of JavaScript to accomplish this behaviour instead of an ASP.NET solution. Something like:
function Q8OngoingClicked(source)
{
//disable end date selections if ongoing is checked
var oMonth = document.getElementById('lstQ8EndMonth');
var oDate = document.getElementById('lstQ8EndDate');
var oYear = document.getElementById('lstQ8EndYear');
if (source.checked)
{
oMonth.disabled = true;
oDate.disabled = true;
oYear.disabled = true;
}
else
{
oMonth.disabled = false;
oDate.disabled = false;
oYear.disabled = false;
}
}<body><input id="chkQ8Ongoing" type="checkbox" name="chkQ8Ongoing" onclick="Q8OngoingClicked(this)" /></body> Now, this works fine (tested with IE6 and FF1.0.6). However, I have added a subroutine that checks each of the responses to see if they are valid before it submits to our database. It states something like, "Question X had an invalid response. Please press your back button to make corrections and re-submit." As some of the gurus of the group can guess when I test the form and press the back button those items that were once disabled are now enabled even if the first item (chkQ8Ongoing in the example above) is checked.

So, I tried an ASP.NET (VB.NET Framework 1.1) approach where I have a function like:

Private Sub Page_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
If Me.IsPostBack Then
ReLoad()
End If
End Sub
...
Private Sub ReLoad()
If chkQ8Ongoing.Checked Then
lstQ8EndMonth.Enabled = False
...
Else
...
End If
End Sub

But this just ends up with an "Reference not set to an instance of an object" error condition. Then I went back to using StarupScript of JavaScript again like:

chkQ8Ongoing = document.getElementById('chkQ8Ongoing');
lstQ8EndMonth = document.getElementById('lstQ8EndMonth');
lstQ8EndDate = document.getElementById('lstQ8EndDate');
lstQ8EndYear = document.getElementById('lstQ8EndYear');
if (chkQ8Ongoing.checked)
{
lstQ8EndMonth.disabled = true;
lstQ8EndDate.disabled = true;
lstQ8EndYear.disabled = true;
}
else
{
lstQ8EndMonth.disabled = false;
lstQ8EndDate.disabled = false;
lstQ8EndYear.disabled = false;
}This works to disable items using Firefox but doesn't work in IE and I don't know why.

What am I missing?
Is there a way to do this purely in ASP.NET?
TIA...
Nov 19 '05 #2
Did I forget the URL?
http://aspnet.4guysfromrolla.com/articles/091405-1.aspx

<%= Clinton Gallagher
"Ferret Face" <ff***@msn.com> wrote in message news:f5********************@giganews.com...
Is there a term for an individual who is half way between a Newby and a Novice?

Anyway, getting down to business...

I am trying to develop an on-line application form for my company's website. In it I have a number of 'Yes/No' or 'Select This Option' type questions where if an option is checked it will disable/enable another. I ended up using ClientScriptBlocks of JavaScript to accomplish this behaviour instead of an ASP.NET solution. Something like:
function Q8OngoingClicked(source)
{
//disable end date selections if ongoing is checked
var oMonth = document.getElementById('lstQ8EndMonth');
var oDate = document.getElementById('lstQ8EndDate');
var oYear = document.getElementById('lstQ8EndYear');
if (source.checked)
{
oMonth.disabled = true;
oDate.disabled = true;
oYear.disabled = true;
}
else
{
oMonth.disabled = false;
oDate.disabled = false;
oYear.disabled = false;
}
}<body><input id="chkQ8Ongoing" type="checkbox" name="chkQ8Ongoing" onclick="Q8OngoingClicked(this)" /></body> Now, this works fine (tested with IE6 and FF1.0.6). However, I have added a subroutine that checks each of the responses to see if they are valid before it submits to our database. It states something like, "Question X had an invalid response. Please press your back button to make corrections and re-submit." As some of the gurus of the group can guess when I test the form and press the back button those items that were once disabled are now enabled even if the first item (chkQ8Ongoing in the example above) is checked.

So, I tried an ASP.NET (VB.NET Framework 1.1) approach where I have a function like:

Private Sub Page_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
If Me.IsPostBack Then
ReLoad()
End If
End Sub
...
Private Sub ReLoad()
If chkQ8Ongoing.Checked Then
lstQ8EndMonth.Enabled = False
...
Else
...
End If
End Sub

But this just ends up with an "Reference not set to an instance of an object" error condition. Then I went back to using StarupScript of JavaScript again like:

chkQ8Ongoing = document.getElementById('chkQ8Ongoing');
lstQ8EndMonth = document.getElementById('lstQ8EndMonth');
lstQ8EndDate = document.getElementById('lstQ8EndDate');
lstQ8EndYear = document.getElementById('lstQ8EndYear');
if (chkQ8Ongoing.checked)
{
lstQ8EndMonth.disabled = true;
lstQ8EndDate.disabled = true;
lstQ8EndYear.disabled = true;
}
else
{
lstQ8EndMonth.disabled = false;
lstQ8EndDate.disabled = false;
lstQ8EndYear.disabled = false;
}This works to disable items using Firefox but doesn't work in IE and I don't know why.

What am I missing?
Is there a way to do this purely in ASP.NET?
TIA...
Nov 19 '05 #3

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

Similar topics

2
by: Donal McWeeney | last post by:
Hi, Just want to get confirmation on the following: I have a custom server control that I implements a postback - I dynamically in my custom control's OnLoad event register the event handler...
11
by: CW | last post by:
I have message entry screen that's causing me a bit of an issue. At the moment, there are 2 buttons, one is used to send message to another user (btnSend) and another is used to send messages to...
2
by: Philippe Camus | last post by:
I didn't find any documentation about this behaviour. On postbacks the Repeater ItemCreated event is fired before Page_Load event It occurs for each item with empty...
0
by: ar | last post by:
Hello, In IE I disable "Automatic prompting for file downloads" which causes the IE information bar to show up when I try to push a file download from an iframe. I want to keep this behaviour. ...
2
by: Paul | last post by:
I've written som junk code below to show a problem I'm getting: On a page I've got a dropdownlist and a button using submit behaviour: <asp:DropDownList ID="tester" runat="server"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.