473,692 Members | 2,220 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

document.getEle mentById(id).va lue Returns Blank

11 New Member
I have this script to validate my reregistration form then send it to a AJAX handler to create the new user my problem is that when getting the value of the username and password filed it returns blank not "undefined" but just "" but it returns the rest of my form fine.
my JavaScript is:
Expand|Select|Wrap|Line Numbers
  1. function send(){
  2.     var user = document.getElementById('user').value;
  3.     alert(document.getElementById('user').value);
  4.     var pass = document.getElementById('pass').value;
  5.     var repass = document.getElementById('repass').value;
  6.     var name = document.getElementById('name').value;
  7.     var email = document.getElementById('email').value;
  8.     var image = document.getElementById('image').value;
  9.     alert(user+'\n'+pass+'\n'+repass+'\n'+name+'\n'+email+'\n'+image);
  10.     //xajax_sendreg(user,pass,repass,name,email,image);
  11. }
and my html is
[HTML]<table width="*" border="0" class="a">
<tr>
<td>Username</td>
<td>
<input name="user" type="text" id="user" /> </td>
<td><span id="user_span"> &nbsp;</span></td>
</tr>
<tr></tr>
<tr>
<td>Password</td>
<td>
<input name="pass" type="text" id="pass" /> </td>
<td rowspan="2"><sp an id="pass_span"> &nbsp;</span></td>
</tr>
<tr>
<td>Retype pass </td>
<td>
<input name="repass" type="text" id="repass" /> </td>
</tr>
<tr>
<td>Name</td>
<td>
<input name="name" type="text" id="name" /> </td>
<td><span id="name_span"> &nbsp;</span></td>
</tr>
<tr>
<td>Valid email</td>
<td>
<input name="email" type="text" id="email" /> </td>
<td><span id="email_span" >&nbsp;</span></td>
</tr>
<tr>
<td>Iamge Verfication </td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><img src="image.php" /></td>
<td>
<input name="image" type="text" id="image" /> </td>
<td><span id="image_span" >&nbsp;</span></td>
</tr>
<tr>
<td colspan="3">
<input type="button" value="Register " id="button" onclick="send() ;"/> </td>
</tr>
</table>[/HTML]

Please help

Thanks Scott.
Nov 17 '07 #1
2 8046
ratcateme
11 New Member
Worked it out i had 2 fields name user and pass sorry
Nov 17 '07 #2
gits
5,390 Recognized Expert Moderator Expert
hi ...

no problem ... glad to hear that you find it out for yourself :) post back to the forum anytime you have more questions ...

kind regards
Nov 18 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2697
by: lawrence | last post by:
This PHP function prints out a bunch of Javascript (as you can see). This is all part of the open source weblog software of PDS (www.publicdomainsoftware.org). We had this javascript stuff working, but it only worked for IE. You can see a working version here: http://www.publicpen.com/designer/mcControlPanel.php username: designer password: designer123 However, I've tried to rewrite this so it would work in all browsers,
4
26587
by: Ghyslaine Crespe | last post by:
Hello, In my script, the line document.getElementById(id).style.background-position = "-200px -500px"; fails ! So, how can I change the background-position value ?
3
9262
by: davidkarlsson74 | last post by:
Error: document.getElementById("folderMenu").cells has no properties File: http://www.volkswagen.se/tillbehor/js/foldermenu.js Rad: 49 The function activates different DIV:s, but doesn't seem to work on FireFox or Netscape. What could be wrong? The function: function setActiveTab(tabNo) {
6
7494
by: Michi | last post by:
Hallo, of course, this doesn't work: document.getElementById('ID').style.-moz-user-select = 'text'; - but i hope it shows my problem... Is it possible to set this css option by javascript and how? Is there any workaround for that? I'd need this to temporarily avoid text selection.
2
4282
by: Katie | last post by:
Hi I have a function which uses the document.getElementById('id') to change attributes of form objects etc. Is there any way i can find out if the element is a checkbox, textbox, radio button etc, because i want to distinguish between them in my function Thanks for ure time and help :)
2
2268
by: vps | last post by:
Please help me get the value of a textarea field: --------------------- The script --------------------- <html> <head> <script type="text/javascript">
29
19257
by: Nick | last post by:
I've seen a few frameworks use the following: function $(id) { return document.getElementById(id); } Then to use: $('something').innerHTML = 'blah'; I'm just trying to roll this out to my site and so far doing this has saved about 8KB of javascript (lots of ajax/dynamic elements). I just
15
7706
by: phub11 | last post by:
Could someone please explain why the following works in IE5, but not FF3? Thanks in advance! function meRelease(id){ endnum = document.getElementById(id).value; alert(endnum); }
1
4214
by: rsingh1980 | last post by:
Hi, I've been struggling with the below piece of code. it works in ie, but not in firefox.. I had to pass a piped string that carries the parameters to another gateway.. one of these was to be a randomized order id. hence the rand procedure. then the concatenation in the getinfo() function This code throws two errors on the firefox error console. Error: document.getElementById("requestparameter") is null
0
8604
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
8538
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8961
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8800
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8801
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4324
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4557
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2974
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 we have to send another system
3
1957
bsmnconsultancy
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.