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

document.getElementById('xyz').value Returns NULL in firefox.. works fine in IE

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


Error: document.ecom.submit is not a function


Any help would be greatly appreciated. Also, if someone can suggest someway to concat the multi variables I need to pass as a piped string in the following line -
input type="hidden" name="requestparameter" value="val1|val2|val3|val4"

it'd be great.
thanks


CODE here

Expand|Select|Wrap|Line Numbers
  1. <head>
  2. <script type="text/javascript">
  3.   var rannum1;
  4.  
  5.     rannum1 = Math.random()*10000000;
  6.     rannum = Math.round(rannum1);
  7. </script>
  8.  
  9. <script>
  10.  
  11.  
  12. //this function will get the variables and pass them to the hidden form fields
  13. function getinfo()
  14. {
  15.  
  16. document.getElementById('requestparameter').value = ("203|DOM|IND|INR|10|"+"UBS"+rannum+"|others|http://www.url.com/success.html|http://www.url.com/fail.html|Diry")
  17. window.alert(requestparameter.value);
  18. }
  19. </script>
  20.  
  21.  
  22. <script src="dpEncodeRequest.js"></script>
  23. <script>
  24. function encodeTxnRequest()
  25. {
  26. document.ecom.requestparameter.value =
  27. encodeValue(document.ecom.requestparameter.value);
  28. document.ecom.submit();
  29. }
  30. </script>
  31. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  32. <title>Untitled Document</title>
  33. </head>
  34.  
  35. <body onLoad="getinfo()">
Apr 6 '10 #1
1 4200
gits
5,390 Expert Mod 4TB
does your node has an id='requestparameter'?

kind regards
Apr 6 '10 #2

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

Similar topics

4
by: Dr. Laurence Leff | last post by:
I am writing a Java program to read in XML file, modify some elements slightly, and then write it out. That XML file is prepared in Docbook. It works fine, except that it is disturbing the...
6
by: John Ramsden | last post by:
.... when the id 'junk' doesn't exist anywhere in the document, instead of returning 'object'?! I am using Javascript for a drop-down menu, slightly adapted from one by Angus Turnbull (see...
3
by: Philip | last post by:
I have just tried my website with Firefox v1.0 and when I try to load a movie using: document.getElementByID('MovieID').LoadMovie(0, 'MovieURL'); the browser tells me that LoadMovie is not a...
6
by: zippy | last post by:
My code works fine in IE but not FF. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
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...
1
by: ppcguy | last post by:
i've got this in firefox and it works var xpath_result = document.evaluate("id('main')/tbody", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null ); var table =...
1
by: shellon | last post by:
Hi all: when I use XPather(a firefox extension) to evaluate the expression: "/html/body/table/tbody/tr/td/table/tbody/tr/td/div/ul/li" it tells me there are 7 matching Nodes. but when I use...
1
by: Zytan | last post by:
if (webBrowserControl.Document == null) is throwing an InvalidCastException. PLEASE NOTE: ***The function being called is being called from a thread OTHER THAN than the one that created the...
9
by: RobertTheProgrammer | last post by:
Hi folks, I've been struggling with this for a few hours and I'm hoping someone can help me out. On my GridView (with C# codebehind) I have a date entry field. To help users enter only valid...
29
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.