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

"document.email_address is null or not object " what is this mean?

52
Hi all
i have error in my forget password where user key in their email address .But the page occur an error "document.email_address is null or not object .
Expand|Select|Wrap|Line Numbers
  1. <script language="javascript">
  2. document.email_address.reset();
  3. </script>
This is use to clear the text in the text box
Expand|Select|Wrap|Line Numbers
  1. <input type="text" title="Please enter your email address" name="email_address" size="20">
Wt can i do to solve the error??
Jul 26 '07 #1
8 1632
pbmods
5,821 Expert 4TB
chaos, please use CODE tags when posting source code. See the REPLY GUIDELINES on the right side of the page next time you post.

As this is really a JavaScript question, I'm going to go ahead and move this thread to the JavaScript forum, where our resident Experts will be better able to help you out.
Jul 26 '07 #2
gits
5,390 Expert Mod 4TB
hi ... when do you want to reset the field's value? have a look at the following example:

[HTML]<html>
<head>
<script type="text/javascript">
function reset_field(id) {
var field = document.getElementById(id);
field.value = '';
}
</script>
</head>
<body>
<input type="text" name="email_address" id="email_address"
value="click the button to change"/>
<input type="button" value="reset field"
onclick="reset_field('email_address');"/>
</body>
</html>
[/HTML]

kind regards

ps: the error you get is due to the fact, that your reference to the field is not correct ;)
Jul 26 '07 #3
chaos
52
hi ... when do you want to reset the field's value? have a look at the following example:

[HTML]<html>
<head>
<script type="text/javascript">
function reset_field(id) {
var field = document.getElementById(id);
field.value = '';
}
</script>
</head>
<body>
<input type="text" name="email_address" id="email_address"
value="click the button to change"/>
<input type="button" value="reset field"
onclick="reset_field('email_address');"/>
</body>
</html>
[/HTML]

kind regards

ps: the error you get is due to the fact, that your reference to the field is not correct ;)

If i want to reset two text field at the same time using the reset button.What will be the code look like???
[HTML]
<label for="password1"">New password:</label>
<input type="password" title="Please enter a password" name="password1" size="20" />
</p>
<p class="style3">
<label for="password2">Re-enter Password:</label>
<input type="password" title="Please re-enter password" name="password2" size="20" />
[/HTML]
Jul 27 '07 #4
pbmods
5,821 Expert 4TB
Heya, Chaos.

If i want to reset two text field at the same time using the reset button.What will be the code look like???
[HTML]
<label for="password1"">New password:</label>
<input type="password" title="Please enter a password" name="password1" size="20" />
</p>
<p class="style3">
<label for="password2">Re-enter Password:</label>
<input type="password" title="Please re-enter password" name="password2" size="20" />
[/HTML]
Check out form.reset().
Jul 27 '07 #5
chaos
52
there dont have much info
Jul 27 '07 #6
pbmods
5,821 Expert 4TB
Heya, Chaos.

there dont have much info
In other words, if you have a form:

Expand|Select|Wrap|Line Numbers
  1. <form name="thePform" ... >
  2. <label for="password1">New password:</label>
  3.     <input type="password"  title="Please enter a password" name="password1" size="20" />
  4.   </p>
  5.   <p class="style3">
  6.     <label for="password2">Re-enter Password:</label>
  7.     <input type="password" title="Please re-enter password" name="password2" size="20" />
  8. </form>
  9.  
You can reset *all* of the inputs in that form by calling:
Expand|Select|Wrap|Line Numbers
  1. document.forms['thePfhorm'].reset();
  2.  
Jul 27 '07 #7
chaos
52
Heya, Chaos.



In other words, if you have a form:

Expand|Select|Wrap|Line Numbers
  1. <form name="thePform" ... >
  2. <label for="password1">New password:</label>
  3.     <input type="password"  title="Please enter a password" name="password1" size="20" />
  4.   </p>
  5.   <p class="style3">
  6.     <label for="password2">Re-enter Password:</label>
  7.     <input type="password" title="Please re-enter password" name="password2" size="20" />
  8. </form>
  9.  
You can reset *all* of the inputs in that form by calling:
Expand|Select|Wrap|Line Numbers
  1. document.forms['thePfhorm'].reset();
  2.  

Thx for your help
It works
[PHP]<script type="text/javascript">
function reset()
{
document.forms['ResetPassword'].reset();
}
// }
</script>[/PHP]

[HTML]<form name="ResetPassword">
<label for="password1"">New password:</label>
<input type="password" title="Please enter a password" name="password1" size="20" />
</p>
<p class="style3">
<label for="password2">Re-enter Password:</label>
<input type="password" title="Please re-enter password" name="password2" size="20" />
</p>
<p style="text-align:left">
<label for="submit">
<input name="submit" type="submit" class="submit-button" value="Change"/>
</label>
&nbsp;&nbsp;&nbsp;
<input type="button" value="Reset" onclick="reset();"/>
</p>
</form>[/HTML]
Jul 27 '07 #8
pbmods
5,821 Expert 4TB
Heya, chaos.

Glad to hear you got it working! Good luck with your project, and if you ever need anything, post back anytime :)
Jul 27 '07 #9

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

Similar topics

7
by: Pablo J Royo | last post by:
Hello: i have a function that reads a file as an argument and returns a reference to an object that contains some information obtained from the file: FData &ReadFile(string FilePath); But ,...
6
by: adamrfrench | last post by:
Let it be mentioned that Javascript is not my forte, so the solution to this could very well be a simple one. I am working on an AJAX function where I can pass a URL and the target ID in, and...
14
by: MuZZy | last post by:
Hi, Lately i've been (and still am) fixing some memory leaks problems in the project i just took over when i got this new job. Among the other issues i've noticed that for localy created objects...
4
by: Peter Hemmingsen | last post by:
Hi, I have a dotnet object (implemented in mc++ and used in c#) which have a property called "Info". The Info property is also a dotnet object (implemented in mc++). In the constructor of the...
1
by: TD | last post by:
I'm using iText in an app to create and print documents to network printers. I launch acrobat via the command line as shown on this page... ...
5
by: rengeek33 | last post by:
I am building a SQL statement for Oracle and need one part of it to read: , myvar = null, myvar2 = "1", myvar3 = "0", myvar4 = null, etc. I am constructing this string using the String...
3
by: sfeher | last post by:
Hi All, The following code returns a valid xmlDoc (since I can evaluate and selectNodes) but its value is "xmlDoc= null" ?! Or at least this is what the FireBug shows and (xmlDoc===null) is...
2
by: Bryan | last post by:
Hello all, Can anyone explain when one should use the "document" object and when one should use the "this" object? Also, is the "self" object the same as the "document" or "this" object?
4
by: dr1ft3r | last post by:
Hey guys, I'm building a site for a landscaping business down the street and can't seem to get part of the code functioning correctly. The code fails on line 68 where I make a reference to an...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
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...
0
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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
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...
0
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
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
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...

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.