Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Ajax
|
Ajax the combination of XHTML, CSS, DOM, XML, XSLT, XMLHttpRequest, and JavaScript
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Ajax section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 6th, 2007, 03:40 PM
Registered User
 
Join Date: Apr 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default value properties in INPUT field

Hi, I have another cross-browser problem.
In my page I have this fileld
<input type="password" name="photoPassword">
outside forms.
In a javascript function I wrote this code

inputPasswordField = document.getElementById("photoPassword");
oXmlHttp.open("get", "./checkPass.php?IDFoto=" + idArray[curImage] + "&Pass=" + inputPasswordField.value, true);

There's no problem with Opera and Internet Explorer, but when I try to use Firefox I receive this message: "Error: inputPasswordField has no properties".

In the Ajax book I'm reading there is a sample code which use the value properties on an INPUT field and it works, but it access in this way:
[i]oForm.elements.value
There's so many differents between two methods?

Thanks again for help

 
Old May 6th, 2007, 03:47 PM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Yes, IE and Opera are wrong, getElementById should not work as there is no id on the element. Either add an id or use the forms/elements collection or use getElementsByName.

--

Joe (Microsoft MVP - XML)
 
Old May 6th, 2007, 05:15 PM
Registered User
 
Join Date: Apr 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks a lot...your help is very precious for me!






Similar Threads
Thread Thread Starter Forum Replies Last Post
Move next input field automatically javaean Java Basics 3 November 16th, 2007 09:27 AM
Modify field properties in linked table RickD Access 1 September 8th, 2006 06:58 AM
Moving input from textbox to field stealthdevil Access VBA 7 May 24th, 2006 11:33 AM
Focus on a text input field fizzerchris Classic ASP Basics 0 December 16th, 2005 09:20 PM
Reading field properties from an Access database Anonymouse VB Databases Basics 0 October 29th, 2004 11:44 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.