Validate long date in javascript & OnSubmit problem

hi i need to validate long date format "E, dd MMM yyyy HH:mm:ss" or Thu, 18 Jul 2002 12:52:49 that is key in by the user. but i'm not sure how to do this. i have couples of input data and i'm passing an object to the javascript function validateform using OnSubmit. Which one is better, using OnSubmit or OnCick for this kind of parameter passing. Eg <form method="POST" action="insert.jsp" onSubmit="return validateForm(this)"> However i'm having a problem where when there is an invalid input from the user, it will notify the user but it will also send the form to the insert.jsp at the same time. Therefore the user can't correct the invalid data. The function return false for valid input and true for invalid. Please help!!! urgent.... thanks in advance

Your problem is you have used
<input type="submit" onClick="OnSubmit();">
this won't work.
Instead try
<input type="button" value="someValue" onClick="OnSubmit();">
This may help. All the best.

Similar Messages

  • How to display images in BI Publisher from a LONG data type

    We are storing images in Oracle Database as LONG data type. When I am giving query in BI Publisher and view the XML generated, I am getting the following error.
    name was started with an invalid character. Error processing resource 'http://.......
    <X_SIGNATURE>"N!0$$$$$$$#B!0$$$"X$$$$!3$$$!2$$#a$$$!1$!1$$$$$d$$$$#7$"X!0$"}@E$e"1"XM">K#@!P!P!Ga}!1!@!P!C#C"O!>...
    Can anyone suggest the solution?

    Hi
    my problem is, for each job_id there is many users. Oh that's something completlty different...
    I Strongly Recommand to_
    1.*create 2 tables Jobs & users*
    2.*create a relation between them* 1 to many to get for each job more than a user that's the way that Must be -- execuse me the bad design of the db pulled u into this trap -
    3.then u can deal with it normally no need to a sample code but just a form with Jobs as  (Master) and Users as (detail) with a relation and with a simple query u can display each job_id is for many users.
    no null values no commas r needed.
    Hope this helps...
    Regards,
    Amatu Allah.

  • HT5429 How long after you report a problem does it take for the fix to be picked up in maps?

    How long after you report a problem does it take for the fix to be picked up in maps? The street I live on is misspelled. It's shown as one word, but it should be two words. Maps cannot find the address when it is spelled correctly, so I have it purposely misspelled it as one word in my contacts, which helps for the most part, however it still tries to place my home on an entirely different street all together. Fortunately this new random street is at least close to where I live. When I used to spell my street correctly with two words, maps would try to send me to the next town over. So it kind of works, as long as I misspell my street, and ignore the fact that it is showing where I live to be a couple of streets down from where I actually live. I live in Connecticut - not in the most populated of areas, but not in the middle of nowhere either. Amazingly enough Google Maps will correctly find my address whether it's spelled with one words or two words. Google Maps also shows my apartment complex, which Apple Maps does not. I really wish Apple would just do a quick pass of the area to fix these issues. I’ve reported the problem several times, months ago. How long will it take for there to be a fix? I keep trying to use the Apple ecosystem, but Google is clearly the better solution for me.

    Apple does not do the GIS data for maps. That comes from 3rd party vendors like Tom Tom. I have read it takes some time to update map data. The only thing you can do is report it.
    Not to belittle your complaint, but on my end it is Apple that is clearly better. When looking at my house in Google, the satellite photo is more than 4 years old, and the Apple one is much newer. I can tell because of the condition of my home and the neighbor's. They had an above ground pool which was removed 4 years ago and it shows on the Google Map. I had remodeling and roof work done to my home that started 3 years ago and Apple's satellite view showed this work done, which took over a year to complete. I live in the middle of a block in a rural town. Both Apple and Google split the block into 100 parts and put my home close to the beginning of the block instead of where it actually sits. I've reported it to both Google and Apple and no one has changed. Just one of those things. But, keep your chin up, it will get corrected eventually.

  • No longer can edit Javascripts after upgrade to 3.0.9.8.4

    We can no longer edit any Javascripts in the Shared Components application since upgrading to 3.0.9.8.4. This has happened on 2 separate installations. When we click "Edit" next to the Javascript name, we are served a blank page. It works fine on 3.0.9.8.2. We are on Solaris 5.8. Database is 8.1.7.4.0. Support is stonewalling, saying that there are invalid objects in a schema that has nothing whatsoever to do with this process.
    Has anyone else seen this problem?

    I just plain have not fixed the Javascript errors. Still no response from Metalink Support. It just doesn't work. There are no errors anywhere. Also, 3.0.9.8.4's Report Component feature can no longer handle any but the most basic and simple of queries. So I have a whole host of reports that I can't even EDIT anymore because the SQL can no longer be parsed! Are these releases even tested?

  • SharePoint Workflow Long Date does not output day of week!

    Hi all, 
    We have developed a workflow that sets a time delay and notifies users after three working days have elapsed. It detects a working day by checking whether the words "Saturday" or "Sunday" occur in the long date version of "Today".
    This workflow was running just fine but recently we found that emails were being sent out on the weekend and the cause for this was that the long date did not contain the day of week at all!. 
    I have been looking at this issue for a while and the only thing I have found is that when I change the site regional settings away from UK, the long date displays correctly again. In fact, it works for most locales, but as soon as I change the locale back
    to UK it stops working again. I have confirmed that this behaviour is consistent across more than one environment, and even on SharePoint Online!!
    Has anyone experienced this or have any solution? To me this seems like a bug and a call to MS but I thought I would post here to see if anyone had similar experiences. The only discussion I have ever found on this subject is linked below but I do not see
    a resolution to the problem. I don't think changing our locale is a solution! :-)
    https://social.msdn.microsoft.com/Forums/en-US/174e853f-69b6-46ab-a1a8-674daec898c0/workflow-lookup-on-datetime-field-format-set-to-long-date-but-missing-day-of-week?forum=sharepointcustomizationprevious
    Thanks,
    Tal

    My last reply that this did not fix the problem when I reactivated the workflow was deleted by someone from this forum post. 
    I still have this issue with the calculated field and will probably end up calling Microsoft Tech Support to have them help me figure out why this works in my WSS 3.0 version of our Sharepoint Help Desk app and not in the SFS 2010 version.  I have the
    exact same formula in the calculated field for both versions.  The SFS 2010 version always changes to "Sat" after any modification and there is no place in the workflows that get invoke when items are changed that this calculated field or any elements
    in the formula get touched.
    Alan-Seattle

  • Javascript alert problem - select state

    I am trying to validate my form with javascript. I'm having
    trouble with my state field. If the user selects a state javascript
    alerts the following message: "SELECT ONE is not a valid choice.
    Please choose your state." I want the alert message to pop up if
    select one is selected as a state. How do I fix this problem?

    pqer wrote:
    > I am trying to validate my form with javascript. I'm
    having trouble with my
    > state field. If the user selects a state javascript
    alerts the following
    > message: "SELECT ONE is not a valid choice. Please
    choose your state." I want
    > the alert message to pop up if select one is selected as
    a state. How do I fix
    > this problem?
    >
    >
    >
    > <script language="javascript"
    type="text/javascript">
    >
    > // check to see if the form is blank
    > function validForm(contactUs) {
    >
    >
    > if(contactUs.state.value != "SELECT ONE") {
    > alert("SELECT ONE is not a valid choice. Please choose
    your state.")
    > contactUs.state.focus()
    > return false
    > }
    if(!contactUs.state.selectedIndex) {
    alert("SELECT ONE is not a valid choice. Please choose your
    state.");
    contactUs.state.focus();
    return false;
    Mick
    >
    > </script>
    >

  • ADF View Object query to use Oracle  LONG data type

    Hi,
    I'm using a view object that uses Oracle LONG data type.The following exception is thrown
    *"java.sql.SQLException: Stream has already been closed"* and it is not fetching the correct data.
    I have searched in many forums,they suggested to use LOB instead of LONG as LONG is deprecated. But in my case I can't avoid using LONG as some of my legacy applications using the same DB.
    Please suggest me a way
    Thanks in Advance
    Felix

    Thanks for your reply Arun,
    I have solved this problem using the solution suggested by this blog [AskTom-Link|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:839298816582]
    In the above blog link,they have suggested to convert Long to Varchar by functions and asked to use this function in the column.
    Thank you all guys who have seen this post.
    Regards,
    Felix

  • How to compare dates using javascript?

    Hi,
    I have to compare dates using javascript. The dates are in format "mm/dd/yy" for eg "10/09/06".
    I have written a script to compare the dates but the problem I 'm facing is with the year.
    For example if I compare "10/09/06" with "10/04/98", then "10/04/98" is coming out to be greater than "10/09/06" because it is considering year "98" to be greater than "06".
    Please advice/suggest.
    Thanks in advance...

    Dude, you're here in a Java forum, not in a Javascript forum. Those are two entirely different languages.
    The answer in Java is to use java.text.SimpleDateFormat to convert String to Date and use java.util.Date and/or java.util.Calendar to compare dates.

  • LONG data types producing errors in 10.1.2.48.18

    Maybe I should already know this but...
    I am getting the " Internal Error has occured " message when I attempt to add a field which is defined as a LONG data type. Can Discoverer handle these fields ? If so is there a setting I am suppose to change ?
    thanks
    OBX

    I know the BLOB problem has come up before as no, I don't think Discoverer will handle them directly (ie: there are example using pl/sql to handle the BLOB first).
    However, I did try just pointing to the eul4_documents table where there is a BLOB (the actual workbook apparently). When I created the folder pointing to that Oracle table I did not get an error in Discoverer Admin.
    Then I created a workbook against that folder bringing everything back. There is no data displayed for the BLOB (doc_document I believe), but I don't get an error. This was - as you may have gathered from the EUL tablename - using Discoverer v4.x. I wonder if it's now different in v10g?
    Just an fyi.
    Russ

  • Adding milliseconds to long date format (tzntstmpl)

    I have a date field called START_DATE defined as type TZNTSTMPL (long date/time format - YYYYMMDDHHMMSS.mmmuuun) and another field call MILLISECONDS also defined as type TZNTSTMPL.
    I want to subtract 625 milliseconds from START_DATE, so I put .625 in the MILLISECONDS field and subtract MILLISECONDS from START_DATE.
    The starting value in START_DATE is "20090701095000.5410000". After I subtract MILLISECONDS from START_DATE the result is "20090701094999.9160000". 
    The result should have been "20090701094959.9160000. The problem is with SS (Seconds) 99 is invalid.
    How can I get it to subtract correctly?
    Are there any ADD or SUBTRACT functions that work with the long date/time format?
    Regards,
    Mike...

    Vindo,
    Thanks that is exactly what I was looking for. It handled the adding and subtract from the long date format correctly.
    Regards,
    Mike...

  • Date validation 'validateDateTimeRange ' giving problem

    Hello Guys,
    We are using ADF 11g(11.1.1.2).
    Here we are trying to validate the date using validateDateTimeRange to validate the date.
    <af:inputDate id="dateLaborIt" required="true"
    binding="#{ClaimsBean.dateLaborPerformedI}">
    *<af:validateDateTimeRange maximum="#{ClaimsBean.currentDate}"*
    *minimum="#{ClaimsBean.purchaseDate}"/>*
    </af:inputDate>
    Occatinally this validation giving me problem when the min and max dates are equal.
    It is giving the validation error as:
    Error : The date is outside the valid Range
    the date must be between "6/25/2011" and "6/25/2011".
    Can any body help me in resolving this issue.
    Regards
    Ahamed

    This is the code that is being generated. The error is occuring on thie line
    var value = field.value;
    The problem is obvious, since the field does not exist it can't get the value... I would like to avoid having to write my own validateDate method..
    function validateDate(form) {
           var bValid = true;
           var focusField = null;
           var i = 0;
           var fields = new Array();
           var formName = form.getAttributeNode("name");
           oDate = eval('new ' + formName.value + '_DateValidations()');
           for (x in oDate) {
               var field = form[oDate[x][0]];
               var value = field.value;
               var datePattern = oDate[x][2]("datePatternStrict");
               // try loose pattern
               if (datePattern == null)
                   datePattern = oDate[x][2]("datePattern");

  • JavaScript onSubmit

    Does one anyone know if it is possible to trigger a JavaScript onSubmit when a list entry is clicked in a List type region? I would like to validate the value in a item when a list entry is clicked but validations are only performed when the page is submitted.

    Scott,
    Try Raj's suggestion: Submit a page from a list
    Scott

  • Simple question: validate infocube data by comparing it with PSA data

    Hi all,
    I want to validate infocube data by comparing it with PSA data, for that i went through PSA via context menu. After that i generated export datasource. Then i am not able to find PSA Export datasource? where can i find that..
    Thanks
    raju

    Hi all,
    I´ve tryied to VALIDATE INFOCUBE DATA BY COMPARING IT WITH PSA DATA making the step by step contained in the HOW TO ...
    The problem is that I have the following error when i activate the transfer rules after aggregating the infoobjet 0TCTREQUID and don´t know how to resolve it:
    " IDoc segment /BIC/CICA7ZBW_RECEP_DI could not be assigned to IDoc ZSCA002
    Message no. RSAR240
    Diagnosis
    The transfer structure is assigned to IDoc ZSCA002 as an IDoc segment for the data transfer between source system and Business Information Warehouse.
    This assignment failed.
    System response
    IDoc segment /BIC/CICA7ZBW_RECEP_DI not known to IDoc V2&. Therefore, no data import can take place from the source system for this InfoSource."
    Any idea of what could have happend?
    Thanks in advance,
    Diego

  • Application crash wen fetching "LONG" data

    Working on an Oracle 9i project on Windows Server 2003 platform with Microsoft VC++ 6.0. When I tried to query a table with column storing LONG data, my simple application keep crashing. The error message is: "This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information.". It happened whenever "l_res->next(); " was added. If this line was removed, everything is OK. Also, if I only query the integer column in the same table, there is nothing wrong. It seems fetching LONG data is not supported in OCCI, am I right? Thanks for help!
    The source code is:
    #include <stdio.h>
    #include <iostream>
    #include <string>
    #include <exception>
    #include <occi.h>
    using namespace oracle::occi;
    using namespace std;
    int main(int argc, char* argv[])
         Environment* l_env = Environment::createEnvironment(Environment::DEFAULT);
         Connection* l_con = l_env->createConnection("scott", "tiger", "test1");
         Statement* l_stmt = l_con->createStatement("select col1, col2 from to_be_drop");
         ResultSet* l_res = l_stmt->executeQuery();
         //l_res->setCharacterStreamMode(2, 4000);
         cout << "status of resultset is: " << l_res->status() << endl;
         l_res->next();
         /*try
              Stream* l_stream = l_res->getStream(2);
         catch(SQLException ex)
              cout << "error no: " << ex.getErrorCode() << endl;
              cout << ex.getMessage() << endl;
         l_stmt->closeResultSet(l_res);     
         l_con->terminateStatement (l_stmt);
         l_env->terminateConnection(l_con);
         return 0;
    The table is:
    create table to_be_drop
         col1 number,
         col2 long
    This table was populated with:
    insert into to_be_drop values (1, 'this is a sunny day?!');
    insert into to_be_drop values (2, 'this is a rainy day?!');
    insert into to_be_drop values (3, 'this is a snowy day?!');
    commit;

    I found where the problem was and solved it. There are two ways to handle this kind of error.

  • How can I retrieve a LONG data type using ADO

    In VB I am using an ADODB object to retrieve data from an Oracle table that has a LONG data type column...
    specifically: SELECT TRIGGER_BODY FROM USER_TRIGGERS WHERE TRIGGER_NAME = 'MYTRIGGER'
    I have tried using the GETCHUNK method but it only returns the first 150 or so characters no matter how
    many times I call it???? here is the sample code I'm using........
    Dim Cn As ADODB.Connection, Rs As ADODB.Recordset, SQL As String
    Dim sChunk() As Byte
    Set Cn = New ADODB.Connection
    Set Rs = New ADODB.Recordset
    Cn.CursorLocation = adUseServer
    Cn.Open "Provider=OraOLEDB.Oracle.1;Password=hrzadmin;Persist Security
    Info=True;UserID=hadmin;Data Source=xxx.local"
    SQL = "SELECT trigger_body from user_triggers where trigger_name = 'MYTRIGGER'"
    Rs.Open SQL, Cn, adOpenStatic, adLockReadOnly
    Debug.Print Rs!trigger_name
    Debug.Print Rs!trigger_body
    sChunk = rs.Fields("trigger_body").GetChunk(500)
    Debug.Print sChunk

    I have a similar code which works for chunk size >400,
    The image I am trying to retrieve is huge so the chunksize is also more.
    Did you try with any non meta table?
    For your reference I am pasting my application code below.
    Hope it helps.
    --Jagriti
    Private Sub cmdGetImage_Click()
    Dim bytchunk() As Byte 'variable to store binary data
    Dim destinationFileNum As Integer 'variable for filenumber
    'recordset for fetching Product Image for the product selected form the list
    Dim recProductImage As New ADODB.Recordset
    Dim offset As Long
    Dim totalsize As Long
    Dim roundTrips As Long
    'variables used in calculation of time taken to fetch the image
    Dim startTime As Currency, EndTime As Currency, time As Currency, Freq As Currency
    Dim i As Integer 'counter variable
    i = 0
    On Error GoTo ErrorText 'redirect to error handler
    '** Step 1 **'
    'validating if product is selected from the list
    If cboSelectProduct.Text = "" Then
    MsgBox "Select product from the list!"
    Exit Sub
    End If
    '** Step 2 **'
    'validating if "optChunk" optionbox is selected then
    '"txtChunksize" textbox should contain a value
    If optchunk.Value = True Then
    'validate if chunksize value is null
    If txtChunkSize.Text = "" Then
    MsgBox "Enter value for chunksize "
    Exit Sub
    End If
    'validating that the chunk size entered should be a positive value
    If CInt(txtChunkSize.Text) < 1 Then
    MsgBox "ChunkSize value should be positive!"
    Exit Sub
    End If
    End If
    '** Step 3 **'
    'open image column from product_information table using m_Oracon connection
    recProductImage.Open "SELECT product_image FROM product_information " & _
    " WHERE product_id =" & cboSelectProduct.ItemData(cboSelectProduct.ListIndex) _
    , m_Oracon, adOpenStatic _
    , adLockOptimistic, adCmdText
    'check if product image exists for the product selected
    If Not IsNull(recProductImage!product_image) Then
    'setting mouse pointer on the form "frmChunkSize" to wait state
    frmChunkSize.MousePointer = vbHourglass
    '** Step 4 **'
    'assigning "desitinationFileNum" variable to next file number
    'available for use
    destinationFileNum = FreeFile
    'allocates a buffer for I/O to the temporary file "tempImage.bmp"
    'at the current application path
    Open App.Path & "\tempImage.bmp" For Binary As destinationFileNum
    '** Step 5 **'
    'Get the frequency of internal timer in Freq variable
    QueryPerformanceFrequency Freq
    'start the timer
    QueryPerformanceCounter startTime
    'clear "imgProduct" imagebox
    imgProduct.Picture = LoadPicture("")
    '** Step 6 **
    If optValue.Value = True And optchunk.Value = False Then
    '** Step 7 **
    'using ADO Value property
    bytchunk = recProductImage("product_image").Value
    'appending byte arrary data to the temporary file
    Put destinationFileNum, , bytchunk
    'displaying "No. of Round Trips" in a label to 1
    lblRoundTrips = 1
    ElseIf optchunk.Value = True Then
    '** Step 8 **
    'converting the value entered "txtChunkSize" textbox to long
    'and assigning it to chunksize variable
    m_chunksize = CLng(txtChunkSize.Text)
    'assigning the actual size of the image retrieved to a variable
    totalsize = recProductImage("product_image").ActualSize
    'calculating and assigning the "No. of Round Trips" to a variable
    roundTrips = totalsize / m_chunksize
    'in case fragment of data left, incrementing roundtrips by 1
    If (totalsize Mod m_chunksize) > 0 Then
    roundTrips = roundTrips + 1
    End If
    'In this loop the image is retrieved in terms of chunksize
    'and appended to the temporary file
    Do While offset < totalsize
    '** Step 9 **
    'retrieving product_image from the recordset, in chunks of bytes
    bytchunk = recProductImage("product_image").GetChunk(m_chunksize)
    offset = offset + m_chunksize
    'appending byte arrary data to the temporary file
    Put destinationFileNum, , bytchunk
    Loop
    'displaying "No. of Round Trips" in a label
    lblRoundTrips = roundTrips
    End If
    '** Step 10 **'
    'stop the timer after image retrieval is done
    QueryPerformanceCounter EndTime
    'close the opened file handle
    Close destinationFileNum

Maybe you are looking for

  • Saving podcasts as non-podcasts - Update

    Last year I started a thread with the title +"Saving podcasts as non-podcasts".+ Although I subscribed to it, notifications somehow ceased to arrive and I forgot about the thread. The problem the thread addressed boils down to the fact that podcasts

  • How can I get iMovie to automatically save to my external hard drive?

    I am trying to use my external hard drive for iMovie because my movies were cramping up my hard drive. I already moved them and that worked fine. The only problem is that I don't know how to get iMovie to automatically save to the hard drive now. I d

  • Message server information not updated for SIDs in SMSY

    How do I get the message server information updated for systems in SMSY? I moved a system from one server to another but the information is not updating for the Java stack. The informatoin was updated successfully for the ABAP, but not the Java side.

  • ABAP Query Auth-Check

    Hello,      I have an issue in regards to ABAP Queries that are accessed via SQ00.  The issue was that a lot of the reports (based on a sample) do not have any authorization check. There is over a 1000 queries, is there any way for me to check the co

  • [Solved]Yaourt sync issue

    I installed yaourt according to the instruction here http://archlinux.fr/yaourt-en But when I run yaourt -Syu --devel --aur , I get an error: problem setting dbpath '//usr/local/var/lib/pacman/' (could not find or read directory) The directory doesn'