![]() |
|
|
#1
|
||||
|
||||
|
onload error
When you use the document.<formname>.submit function I get an error that states
document.<formname> is null or not an object Anyone got any ideas how to get rid of this error? I'm expecting expat to know this 1
__________________
Certified Native Translations and EMedia Services - PM me if you are interested? Web Services |
|
#2
|
|||
|
|||
|
Quote:
if it's regarding the bit of script I think you reffer to.... onload <formname> object MUST exist the object is the actual form name used! .. echo"onLoad='document.SecureForm.submit();'"; (watch the quotes and semikolons) ...echo "<form target=\"_self\" action=\"https://www.paypal.com/cgi-bin/webscr\" name=\"SecureForm\" method=\"post\">"; M |
|
#3
|
||||
|
||||
|
I have the form inside an IF clause which I think why it's causing the error because when it isn't being called it doesnt exist.
hmmm.. I'll have to to think through the pseudocode
__________________
Certified Native Translations and EMedia Services - PM me if you are interested? Web Services |
|
#4
|
|||
|
|||
|
Quote:
eg if gatway pp form with pp details else form to print or so (action print.php) end |
|
#5
|
|||
|
|||
|
use this:
instead Code:
document.<formname> Code:
document.getElementById('<formname>')
|
|
#6
|
|||
|
|||
|
Quote:
Code:
document.getElementById("formid");
document.getElementsByName("formname").item(0);
Last edited by J.D.; Jan 18th 2005 at 6:01 am. |
|
#7
|
|||
|
|||
|
Quote:
show me one browser used by more than 5% of the total users over the internet, which does not work well with getElementById |
|
#8
|
|||
|
|||
|
Quote:
Code:
<html>
<head>
<script type="text/javascript">
function myonclick(input)
{
alert(document.getElementById("formid").nodeName);
alert(document.getElementById("formname").nodeName);
alert(document.getElementsByName("formname").item(0).nodeName);
}
</script>
</head>
<body>
<form id="formid" name="formname" action="formid.html">
<input type="button" onclick="myonclick(this)" value="Click!">
</form>
</body>
</html>
J.D. |
|
#9
|
|||
|
|||
|
it won't logicaly work.... and the bug is here:
alert(document.getElementById("formname").nodeName); you don't have an id="formname" there.... why do you try to use it? it works only in IE, because IE is tought that way.... but logicaly you are calling a unknown element by an unexistent ID... It is somehow my bad cause I forgot to mention that <formname> must be be passed to id also... Quote:
|
|
#10
|
|||
|
|||
|
furthermore if you would use CSS... you'd notice that distinct IDs help a lot
|
|
#11
|
|||
|
|||
|
Quote:
J.D. |
![]() |
| Bookmarks |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| CC Authorize error code | smonahan | Optigold ISP | 19 | Mar 21st 2006 4:52 pm |
| Parse Error | vintageagain | Co-op Advertising Network | 6 | Nov 7th 2004 2:28 pm |
| Call to undefined function error | Patient | Co-op Advertising Network | 2 | Nov 2nd 2004 6:08 am |
| LinkSwapper programming error | Shine | Programming | 1 | Aug 26th 2004 7:10 pm |
| Web Access Error | craig | Optigold ISP | 8 | Jun 30th 2004 2:51 pm |