473,834 Members | 2,333 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

document.getEle mentById("start timeScheduler") returns null

2 New Member
Hi, I am working on a webapplication, ( with Ajax & JSF) where I want to retrieve the value present in a
Expand|Select|Wrap|Line Numbers
  1. <t:inputText id="starttimeScheduler"  value="#{scheduledJobCreateEdit.startTimeDate}" style="width:165px; margin-left: 25px;" forceId="true" tabindex="112">  
by using
Expand|Select|Wrap|Line Numbers
  1. document.getElementById("starttimeScheduler") 
in my javascript function. but this is always returning null. The <t:inputText > is present with in a <t:div>. Can you please let me know , how can I get the <t:inputText > value . I have the issue with both FF and IE 7.
Mar 28 '08 #1
3 2374
malav123
217 New Member
Hi,
pass the form and use it in java script, and if you are using master page then use the prefix of content place hoder and form your problem will be solved...
Mar 28 '08 #2
karprix
2 New Member
Hi,
pass the form and use it in java script, and if you are using master page then use the prefix of content place hoder and form your problem will be solved...
I didnt understand , when you mentioned "pass the form".
THe code I have is :
Expand|Select|Wrap|Line Numbers
  1. function checkScheduledDate()
  2. {
  3.  var scheduledTime = document.getElementById("starttimeScheduler"); 
  4.  if(scheduledTime == null)    
  5.  {
  6.    return false;
  7.  }
  8. }
  9.  
  10. <h:form>
  11. ...
  12. <t:div id="contents_starttime_div" styleClass="contents" style="border:none;">
  13. <t:inputText id="starttimeScheduler"  value="#{scheduledJobCreateEdit.startTimeDate}" style="width:165px; margin-left: 25px;" forceId="true" tabindex="112">
  14. <f:convertDateTime pattern="#{cal['jsfcalendar.pattern']}" locale="#{facesContext.viewRoot.locale.language}"/>
  15. </t:inputText>
.....

Now in my javascript function, I want to retrieve the value present in the input text at the time of form submission. So, I am calling the javascript function on submit, but the function always returns null on document.getEle mentById().
Please help me out here.
Mar 28 '08 #3
malav123
217 New Member
Hi,
you just call the function from submit button like,
Expand|Select|Wrap|Line Numbers
  1.  Btn.Attributes.Add("onClick", "return yourfunction(this.form)")
and in your javascript use simply,
Expand|Select|Wrap|Line Numbers
  1. yourfunction(f)
  2. {
  3.          if(f.starttimeScheduler=="")
  4.                            alert("message");
  5. }
  6.  
now it will work fine for u.....
Mar 31 '08 #4

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

Similar topics

2
7137
by: Rene van Hoek | last post by:
Hi, I am using Xalan 1.8.0 and Xerces 2.6.0 in C++. I have an XML document which I first transform into an other XML document using an XSL styelsheet. Then I want to parse with XPathEvaluator the new XML document. I succeed in transforming, also in parsing with the XPathEvaluator. But I can not get any nodeValue, getNodeValue() returns NULL.
1
15308
by: Suresh | last post by:
Hi, I have an C# CSEXE.exe (CSexe.cs) and a CSDll.dll (CSdll.cs). exe is compiled with a reference to dll. Calling for the class Type defined in CSDLL.dll using Type.GetType( "myDLLnamespace.CSDll" ) returns null. I made sure that the fully qualified class defined in the dll is case-sensitive. // CSEXE.exe
2
3418
by: Jeff Adams | last post by:
I am using MSVC .NET to create a C program. I am having trouble creating a window. The createwindow returns NULL however no error is caught. The GetLastError() returns "operation completed successfully". So I'm not sure what the deal is. CreateWindow doesn't have to be called from the main function does it? WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, MsgProc, 0, 0, GetModuleHandle(NULL), NULL, NULL, NULL, NULL, ...
1
3675
by: BeckyB00 | last post by:
Slightly different situation from the question of the 11/18/05 but the same error. (I'm just learning about web services so this is based on a 'quick tutorial') I'm running a web service using Axis and want to consume it with a .NET client. So I've created the web proxy using wsdl.exe and I can call the service and it responds but the client returns null. If I run a Java client then it gets the response fine and dandy. The web service...
0
1454
by: Zean Smith | last post by:
I am trying to get my C# client to connect to a 3rd Perl Web Service (SOAP Lite), this is the code that fails ...... object results = this.Invoke("getGrossData", new object {week} ); return ((string)results); ....... The problem: It always return a NULL in results. Why is that??
11
1921
by: MLH | last post by:
I have 2 lines in a procedure that assign MyVariant a value - line #238 and line #491. When line #238 runs, the value is 152. When line #491 runs, the DLookup function returns Null. I would expect MyVariant to be Null. But it is not. Its value is still reported as 152. I'm able to confirm its value is not Null by running IsNull(MyVariant) immediately after line #491. 238 MyVariant = Forms!frmUSPSReturnReceipts!RROLAXchewsurBox.Column(3)...
1
14523
by: js | last post by:
I am using the following C# code and T-SQL to get result object from a SQL Server database. When my application runs, the ExecuteScalar returns "10/24/2006 2:00:00 PM" if inserting a duplicated record. It returns null for all other conditions. Does anyone know why? Does anyone know how to get the output value? Thanks. ------ C# ----- aryParams = {'10/24/2006 2pm', '10/26/2006 3pm', 2821077, null}; object oRtnObject = null;...
3
4181
pragathik
by: pragathik | last post by:
hi, i have a problem with document.body.offsetTop and document.body.offsetLeft always returns null in my code in IE6. how can I get the values???? please suggest
2
5056
by: wizardry | last post by:
hello - i'm trying to insert a blob into my table, it will insert but the string that i insert when i query the inserted data returns null with 0 bytes in the column. I have other tables set up this way and i'm able to insert text data into it with no problems. I've checked the database design its basiclly a duplicate. I did have to remove my not null on the long blob element. but other then that, i don't understand why this is...
9
14220
by: ipanos | last post by:
Hey guys... I am not too knowledged in js and I code in it occasionally, so please excuse the question if it is steight forward... Now... Been working on an analogue clock script, customised it exactly to my needs, until I got to the point of calling it in my body... I am trying to enter the clock inside a div but when I call it by document.getElementById nothing happens. Console on firefox says that it returns null. Initially I...
0
9796
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
9643
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
10786
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10503
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
10544
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
5624
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
5790
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3973
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3079
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.