Hi,
I am using ASP.NET AJAX to check username availability in a registration
form. Everything works fine in IE but not in FF. Using Firebug, i can find
the offending line but not sure what to about it. The error firebug gives
txtUsername has no properties. Not sure how to fix this. Thank you for any
help.
var txtUserName;
function pageLoad()
{
txtUserName = $get("<%=Username.UniqueID %>");
}
function CheckUserName()
{
if (txtUserName.value.length 0)
{
$get("imgWaitingUsername").style.display = 'inline';
$get("spanUsername").innerHTML = 'Checking Username Availability...';
$get("spanUsername").style.color = "red";
$get("spanUsername").style.fontWeight = "bold";
PageMethods.CheckUserName(txtUserName.value, OnCheckUserName);
}
else
$get("spanUsername").innerHTML= "";
reqvalUsername.innerHTML = "Username is required";
} 5 1360
Hi,
Showjumper wrote:
Hi,
I am using ASP.NET AJAX to check username availability in a registration
form. Everything works fine in IE but not in FF. Using Firebug, i can find
the offending line but not sure what to about it. The error firebug gives
txtUsername has no properties. Not sure how to fix this. Thank you for any
help.
Which is the offending line?
You have a missing '{' on the line indicated by "HERE" (see below).
You should really start to indent your code and use a consistent code
guideline, it would make your code easier to read and to debug.
HTH,
Laurent
>
var txtUserName;
function pageLoad()
{
txtUserName = $get("<%=Username.UniqueID %>");
}
function CheckUserName()
{
if (txtUserName.value.length 0)
{
$get("imgWaitingUsername").style.display = 'inline';
$get("spanUsername").innerHTML = 'Checking Username Availability...';
$get("spanUsername").style.color = "red";
$get("spanUsername").style.fontWeight = "bold";
PageMethods.CheckUserName(txtUserName.value, OnCheckUserName);
}
else
HERE
>
$get("spanUsername").innerHTML= "";
reqvalUsername.innerHTML = "Username is required";
}
--
Laurent Bugnion [MVP ASP.NET]
Software engineering, Blog: http://www.galasoft.ch
PhotoAlbum: http://www.galasoft.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Error in Firebug is txtUserName has no properties. Offending line appears to
be
if (txtUserName.value.length 0)
Took care of the missing bracket and it still does not work in FF but works
in IE.
Also My code IS indented in VS.
"Laurent Bugnion, MVP" <ga*********@bluewin.chwrote in message
news:e7**************@TK2MSFTNGP05.phx.gbl...
Hi,
Showjumper wrote:
>Hi, I am using ASP.NET AJAX to check username availability in a registration form. Everything works fine in IE but not in FF. Using Firebug, i can find the offending line but not sure what to about it. The error firebug gives txtUsername has no properties. Not sure how to fix this. Thank you for any help.
Which is the offending line?
You have a missing '{' on the line indicated by "HERE" (see below).
You should really start to indent your code and use a consistent code
guideline, it would make your code easier to read and to debug.
HTH,
Laurent
>> var txtUserName;
function pageLoad()
{
txtUserName = $get("<%=Username.UniqueID %>");
} function CheckUserName()
{
if (txtUserName.value.length 0)
{
$get("imgWaitingUsername").style.display = 'inline';
$get("spanUsername").innerHTML = 'Checking Username Availability...';
$get("spanUsername").style.color = "red";
$get("spanUsername").style.fontWeight = "bold";
PageMethods.CheckUserName(txtUserName.value, OnCheckUserName);
}
else
HERE
>> $get("spanUsername").innerHTML= "";
reqvalUsername.innerHTML = "Username is required";
}
--
Laurent Bugnion [MVP ASP.NET]
Software engineering, Blog: http://www.galasoft.ch
PhotoAlbum: http://www.galasoft.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Hi,
Showjumper wrote:
Error in Firebug is txtUserName has no properties. Offending line appears to
be
if (txtUserName.value.length 0)
That error means that the control named after "<%=Username.UniqueID %>"
doesn't exist on your page. It's null, so when you try to access the
"value" property, it throws an error.
You must find why there is no such control on your produced page. Try to
view the produced HTML source (on the web client) and see if it's here.
Took care of the missing bracket and it still does not work in FF but works
in IE.
That's rather surprising for this error. Compare the produced HTML code
in IE and in Firefox. Do you see differences?
Also My code IS indented in VS.
OK, that's good. I use "Insert spaces" instead of "Keep tabs" in the
"Text editor" options in VSto avoid this kind of annoyance when I
copy/paste code.
HTH,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering, Blog: http://www.galasoft.ch
PhotoAlbum: http://www.galasoft.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Fixed the issue: it was the Unique ID reference which worke din IE but not
in FF.
"Laurent Bugnion, MVP" <ga*********@bluewin.chwrote in message
news:Oe**************@TK2MSFTNGP02.phx.gbl...
Hi,
Showjumper wrote:
>Error in Firebug is txtUserName has no properties. Offending line appears to be if (txtUserName.value.length 0)
That error means that the control named after "<%=Username.UniqueID %>"
doesn't exist on your page. It's null, so when you try to access the
"value" property, it throws an error.
You must find why there is no such control on your produced page. Try to
view the produced HTML source (on the web client) and see if it's here.
>Took care of the missing bracket and it still does not work in FF but works in IE.
That's rather surprising for this error. Compare the produced HTML code in
IE and in Firefox. Do you see differences?
>Also My code IS indented in VS.
OK, that's good. I use "Insert spaces" instead of "Keep tabs" in the "Text
editor" options in VSto avoid this kind of annoyance when I copy/paste
code.
HTH,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering, Blog: http://www.galasoft.ch
PhotoAlbum: http://www.galasoft.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Thanks for your help.
"Laurent Bugnion, MVP" <ga*********@bluewin.chwrote in message
news:Oe**************@TK2MSFTNGP02.phx.gbl...
Hi,
Showjumper wrote:
>Error in Firebug is txtUserName has no properties. Offending line appears to be if (txtUserName.value.length 0)
That error means that the control named after "<%=Username.UniqueID %>"
doesn't exist on your page. It's null, so when you try to access the
"value" property, it throws an error.
You must find why there is no such control on your produced page. Try to
view the produced HTML source (on the web client) and see if it's here.
>Took care of the missing bracket and it still does not work in FF but works in IE.
That's rather surprising for this error. Compare the produced HTML code in
IE and in Firefox. Do you see differences?
>Also My code IS indented in VS.
OK, that's good. I use "Insert spaces" instead of "Keep tabs" in the "Text
editor" options in VSto avoid this kind of annoyance when I copy/paste
code.
HTH,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering, Blog: http://www.galasoft.ch
PhotoAlbum: http://www.galasoft.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Mark Olbert |
last post by:
The doPostBack javascript functioning is not submitting the page when called by linkbuttons (or an
autopostback checkbox, for that matter).
I'm aware of a problem with Netscape browsers and the...
|
by: Gerald Stampfel |
last post by:
Hi,
i am doing ajax requests to an IIS server. the response is a JSON
string, stored in xml.responseText. in IE everything is fine. in
firefox, only a part (80%) of the string is delievered in 8...
|
by: evgenyg |
last post by:
Hello !
We have the following situation - when Ajax request is sent what's
being returned by the server is usually an XML (which is used for DOM
updates) but sometimes it's HTML which is a whole...
|
by: ext237 |
last post by:
Simple ajax call seems to have some issues in Firefox. The "onComplete:" is
called BEFORE the response is returned by the call. Is there a coding issue
or a work around?
var ajax = new...
|
by: germ |
last post by:
doing a simple page webmethod call an a page via PageMethods works fine in
ie7 & opera9
the same call on firefox ( and I assume netscape ) generates the following
error :
Error: " nsresult:...
|
by: jrnail23 |
last post by:
I have a user control which contains an UpdatePanel, which contains a
MultiView inside, with a GridView in one of the views.
In my GridView, I have a ButtonField which is supposed to trigger a...
|
by: raknin |
last post by:
I am creating a dynamic list on the server using php file,when I run the PHP script in all 4 browsers (IE 6, Firefox 2, opera and safari 3) every think go Ok and the list is created. but when I call...
|
by: SAL |
last post by:
Hello, I did google this issue and found some stuff related to BrowserCaps
section of either web.config or machine.config but it didn't work.
It seems that most pages in my webapp are okay but a...
|
by: SAL |
last post by:
Hello,
I'm trying to include a popup in the ItemTemplate of a gridview row. The
ItemTemplate for the field contains a textbox and when the user clicks in
the textbox I want a popup panel to show...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
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...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
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...
| |