Document.wwv_flow.f07.length

Hi
I am facing problem in a JavaScript validation. In my tabular form (manual) i have put the following JavaScript code which fires on a button press.
The problem I am facing is when the tabular form has just 1 row document.wwv_flow.f07.length return "undefined" whereas it should return 1 but if it has more than 1 rows it returns correct number of rows.
Please help me in fixing this problem.
function checkAmountAll()
if ( $v("P46_STD_PREPAY") == "S"  )
  alert( document.wwv_flow.f07.length );
  for (var i = 0; i<document.wwv_flow.f07.length; i++) {
   if ( parseFloat(document.getElementsByName('f07').value) > parseFloat(document.getElementsByName('f04')[i].value) )
{      alert( "Invalid receipt amount at Row " + (i + 1) );
return false; }
return true;
Habib

Hi Habib,
getElementsByName will always return an array, document.wwv_flow.f07 will only do so if there is more than one record, otherwise it will return a single object (so, "length" does not apply).
You should use getElementsByName throughout - or check for (document.wwv_flow.f07.length != "undefined")
Andy

Similar Messages

  • Problem (IE) with document.wwv_flow.f01.length after upgrade 4.1.1.00.23.

    In case anyone has had this issue (or is about to), there is a new bug after the upgrade to 4.1.1.00.23 with tabular forms and using document.wwv_flow.f01.length during onload. Seems to happen with Internet Explorer 7 or 8. Doesn't happen with the versions of Firefox nor Chrome that I have and also didn't happen with IE prior to the upgrade.
    Check it out here (simple example uploaded to apex.oracle.com):
    http://apex.oracle.com/pls/apex/f?p=36869
    First try it with Firefox or Chrome.
    1. Go into the page.
    2. You should get a popup telling you the number of rows.
    3. Hit 'add rows'. You should get a popup telling you the number of the nth row that you just added.
    Now try it with IE and see what happens. #2 doesn't work anymore. Instead it's some alert box with junk in it for some function declaration not even on my page! Probably coming from the Apex library somewhere.
    Why do we care? Well most of us probably don't, but in my case in my real app I evaluate document.wwv_flow.f01.length in order to do some conditional javascript processing and that gobbledygook messes it all up.

    Hi,
    You need to pass the array length into the onload call, so just amend the onload call like this
    if (window.addEventListener) // W3C standard, for Firefox, Chrome, etc.
      addLoadEvent(InitDetailItems(document.wwv_flow.f01.length));
    else if (window.attachEvent) // Internet Explorer
      addLoadEvent(InitDetailItems(document.wwv_flow.f01.length));Thanks

  • Document.wwv_flow.submit is not a function -Error

    Hi All,
    Apex page have jquery,javescript etc..however..when i am trying ti hit the Button ..throwing error below like this..
    document.wwv_flow.submit is not a function
    and no Action at all..
    Please help me on this...

    You obviously haven't learnt from your last post
    Apex region button /page issue.
    Please read the forum FAQ https://wikis.oracle.com/display/Forums/Forums+FAQ
    and try to supply as much information about the problem as you can, such as how your button is defined, what pertinent attributes it may have set, any other factors that may impact the result - such as what jquery / javascript code you have on the page - not just stating that it exists.
    Scott

  • Button error - document.wwv_flow.p_request is null or not an object

    Hello
    I currently seem to be getting a page error with Internet explorer, whenever I click a button, the error is 'document.wwv_flow.p_request' is null or not an object, the button then stays disabled.
    The error doesn't seem to occur on all the pages I have created, but on most.
    Any ideas?
    Cheers ian

    I have just noticed that the problem seems to be related to the submit rather than the button itself, as the redirect buttons work, but anything that uses a submit does not work i.e select lists (with submit).
    Is this something that I can fix?

  • Error: 'document.wwv_flow.request' is null or not an object.

    I've problems with the buttons in my Application.
    When I create one and click I after, I've allways the Error Message: Error: 'document.wwv_flow.request' is null or not an object.
    But if I create the same butten on my test application, I don't have this error message.
    Whats wrong?
    Thanks
    Dean

    Dean,
    Can you be a bit more specific? What it the difference between "my Application" and "my test application"? What are you doing differently when you are creating these buttons?

  • Document.wwv_flow.submit is not a function

    I am able to create tab using following jquery source.
    <script type="text/javascript">
    //<![CDATA[  
      $(function(){    
          $tabs = $("#my_dashboard_tabs");  
          $tabs.tabs({
        load: function(event, ui) {
            $('a', ui.panel).click(function() {
                $(ui.panel).load(this.href);
                return false;
    $("ul.ui-tabs-nav").css({width:"350px"});
    $tabs.show();
    //]]>
    </script>
    <!--
    The HTML region section I have added following html code
    <div id="my_dashboard_tabs">
    <ul>
    <li>Employee</li>
    <li>Departments</li>
    </ul>
    </div>
    -->
    The jquery tabs are working smoothly. But "Document.wwv_flow.submit is not a function" (Firefox firebug) error mesage appearing when i tried to leave from jquery tabbed page. click actions are not working outside of this page beacuse of this error message.
    I couldn't under stand what is the exact error message.
    ((internet Explorer : "Object doesn't support this property or method")
    I will appreciate if somebody can help me
    Regards
    Edited by: satheeshkumars on Aug 23, 2009 11:55 AM

    This may not help you at all, but we are also encountering this issue when we have javascript on the page. All of the buttons on the page come back with the Object doesn't support this property or method error in IE.
    You can get around it by putting URL in the button TARGET property and passing in javascript:enter() and then in the HTML Header you can put a function like this:
    function enter() {
    var asset = html_GetElement('P4_ASSET_LIST').value;
    var date = html_GetElement('P4_DATE').value;
    var url = "f?p=&APP_ID.:5:&SESSION.::::P5_ASSET_ID,P5_DATE:"+asset+","+date;
    window.location = url;
    This is very clumsy, but it does work for buttons.

  • Document.getLength & CharSequence.length

    Hi Guys,
    I am using get setcharacterAttributes to render some views,
    The Startoffset and endOffset are obtained using regex and CharSequence.
    On displaying the document, the style is applied to the wrong range.
    On checking the CharSequence used on the file input stream the document was created from, the length returned were different.
    Please help!!
    Below is a snippet of my code.
    ++++++++++++++++++
    private void scanTags() {
    myScanner scanner = new myScanner(this.fileName);//using regex
    CharSequence cbuf = scanner.getBuffer();
    System.out.println(cbuf.length());
    Vector locList = scanner.scan("<");
    Segment text = new Segment();
    text.setPartialReturn(false);
    int pos = 0;
    try{
    while (pos < this.getLength()){
    this.getText(pos,this.getLength() - pos,text);
    pos+=text.count;
    }catch(BadLocationException ble){;}
    System.out.println(this.getLength());
    for (int n = 0; n < locList.size(); n++){
    int loc = ((StringPosition)locList.get(n)).getStartOffset();
    for(int no = 0; no < tagList.size(); no++)
    String token = (String)tagList.get(no);
    System.out.println(text.array[loc]);
    String scanToken = (cbuf.subSequence(loc +1,loc + 1 + token.length())).toString();
    System.out.println("Location= " + loc + " starttoken set " + token + " Obtained " + scanToken);
    if((token.compareTo(scanToken) == 0)){
    System.out.println(" Yes starttoken set " + token + " Obtained " + scanToken);
    int endStr = loc + token.length() + 1;
    System.out.println(cbuf.subSequence(endStr,endStr +1).toString());
    if ((cbuf.subSequence(endStr,endStr +1).toString()).compareTo(" ") == 0){ //|| (cbuf.subSequence(endStr,endStr +1).toString()).compareTo(">") == 0){
    this.setNodeColor(loc+1,token.length(),0);
    System.out.println("setting toke color t " + token);
    // }catch(BadLocationException ble){;}
    }//Scantags
    //SetNodeColor
    public void setNodeColor(int startOffset,int endOffset,int nodeType){
    System.out.println("Starting Pos = " + this.getStartPosition() + " stting attr at " + startOffset + " length= " + endOffset);
    this.setCharacterAttributes(startOffset,endOffset,attrs[nodeType],false);

    Well, I'm not going to take the time to attempt to read unformatted code. Learn to use the [ code ] and [ /code ] tags.
    If I understand then question then here is something you should be aware of:
    1) A Java document only stores a single newline character (\n)
    2) Windows files store two characters (\r\n)
    There is a property that you can set on the document to control the newline string for the document:
    document.putProperty( DefaultEditorKit.EndOfLineStringProperty, "EOL" );
    When you use the getText() method, all newline characters will be replaced with "EOL".
    However, I'm not sure if the getLength() method with use 3 or 1 as the newline character length.
    Probably not a solution, but hopefully it helps explain the problem.

  • Cs4 Recent documents file path length?

    This is bugging me. Why, under Recent Documents, do some files have the entire file path starting with the hard drive name > user name > ad nauseum and other files have just the document name?
    Is it because I opened some within the program and the others from the finder? (I open and close so many, I never keep track)
    Apparently there is no preference option to chose one format over the other.
    Annoying, that's all.

    One idea -- don't know if this fits your situation.  On other Adobe programs I have seen this when the same  document name was opened from different folders.  For example if I had a file DocA that was only opened from one folder it would appear in the list as DocA with no path; but if I had opened a file named DocB from folder 10 then later from folder 12, I would see two entries with paths showing those folders.

  • Help with validation on a manually created tabbed form

    version 4.1.1.00.23
    Hello,
    I have a manually created tabbed form that I'm having trouble creating validation on.
    The page is a Resource Staffing page where PM's can forecast the Resources that will be needed for various projects. The forecast can be for 12 - 18 months.
    The requirement is to display a message to the user if they are trying to save a row without forecasting any time. It's possible they may not know how may Resources or the length of time needed when the row is created.  If they respond that they want to save the row without time the MRU will create the record. If they answer that they do not want to save the row they are returned to the page without loss of information.
    The month fields on the page are defaulting to 0 (zero).
    I've updated the Save button to Redirect to URL and in the URL Redirect I have: javascript:confirmNoTimeSaved()
    The javascript:
    [code]
    function confirmNoTimeSaved()
        var arr_jan,arr_feb,arr_mar,arr_apr,arr_may,arr_jun,arr_jul,arr_aug,arr_sep,arr_oct,arr_nov,arr_dec = new Array();
            arr_jan = document.wwv_flow.f07;
            arr_feb = document.wwv_flow.f08;
            arr_mar = document.wwv_flow.f09;
            arr_apr = document.wwv_flow.f10;
            arr_may = document.wwv_flow.f11;
            arr_jun = document.wwv_flow.f12;
            arr_jul = document.wwv_flow.f13;
            arr_aug = document.wwv_flow.f14;
            arr_sep = document.wwv_flow.f15;
            arr_oct = document.wwv_flow.f16;
            arr_nov = document.wwv_flow.f17;
            arr_dec = document.wwv_flow.f18;
        for(i = 0; i < arr_jan.length; i++)
            if(arr_jan[i].value == 0 && arr_feb[i].value == 0 && arr_mar[i].value == 0
                && arr_apr[i].value == 0 && arr_may[i].value == 0 && arr_jun[i].value == 0
                && arr_jul[i].value == 0 && arr_aug[i].value == 0 && arr_sep[i].value == 0
                && arr_oct[i].value == 0 && arr_nov[i].value == 0 && arr_dec[i].value == 0)
                txt = 'You have no time assigned to your Forecast. Do you want to save this Forecast without time entered?' + '\n' + '\n' + '"Yes" to save the Forecast.' + '\n' + '"No" to return with no changes.';
                caption = 'Confirm Saving With No Time';
                vbMsg(txt,caption)
                switch (isChoice)
                    case 6:
                        doSubmit('SUBMIT');
                        break;
                    case 7:
                        doSubmit('CANCEL2');
                        break;
            else
                doSubmit('SUBMIT');   
                break;
    </script>
    <script language="VBScript">
    <!--
    //Yes    = 6
    //No     = 7
        Function vbMsg(isTxt,isCaption)
            testVal = MsgBox(isTxt,vbYesNo,isCaption)
            isChoice = testVal
        End Function
    //-->
    </script>
    [/code]
    The 'CANCEL2' is just a Branch I'm using to branch back to the page without clearing Cache. I do have 'Cancel' button on the page and the Branch created for that clears the Cache.
    While debugging the javascript I get into the VB Script on the testVal = MsgBox(isTxt,vbYesNo,isCaption) line and the browser crashes.
    Can someone help with this requirement?
    What additional information can I provide?
    Thanks,
    Joe

    The code above is my attempt at this requirement, however, the browser crashes when it gets to the VBScript on the MsgBox call. I don't have to use this approach. Does someone have an idea how to solve this?
    Thanks,
    Joe

  • Table Validation - Report errors without losing changes

    Hi all,
    I am experimenting with table validation based on Denes Kubicek's example at http://apex.oracle.com/pls/otn/f?p=31517:41. I have had no problems getting this working,
    but I need to stop if loosing data when the validation rules are not met.
    If I have 10 rows in my table and the user updates 6 of these with valid new values and 1 with an invalid value then the submit button causes the error message to be shown as expected, but the page / table reverts back to the data from the databse and all the other changes are lost.
    How can I get the page to keep the entered values when the page is refreshed?
    Thanks,
    Martin

    Martin,
    You may need to replace the validation using JS. JS equivalent for Denes e.g.
    Put this in page HTML Header..
    <script type="text/javascript">
    function f_validate()
         var comm;
            var dept;
            var err ='';
         for (i=0;i < document.wwv_flow.f02.length;i++)
         comm = document.wwv_flow.f07.value;
         dept = document.wwv_flow.f08[i].value;
         if (comm > 2000 && dept == 20)
              err = err + 'Error at Row ' + i;
    if (err == '')
    doSubmit();
    else
    alert (err);
    document.wwv_flow.f07[0].focus();
    </script>
    Change the 'Submit' button target to URL and type javascript:f_validate(); as URL Target
    Cheers,
    Hari
    Edited by: Hari_639 on Oct 29, 2009 7:07 PM

  • RemoveAtt by column in Tabular Form

    Hi guys. This is my problem:
    I have a tabular with "select list" fields. I disable this fields on Load Page if pk is not null, so user can't modify value of this fields. But when I insert new row in tabular form i have an error from MRU (because select list fields are disable). So how can i remove attribute "disable" before submit pages from column with "select list" disabled?
    Thanks for help.

    You just need to modify this code slightly and have it execute on page submit
    if (document.wwv_flow.f25) { // Check to see at least one present
    var l = document.wwv_flow.f25.length;
    if (l == undefined) { // Have only one record
       var curr_id = document.wwv_flow.f25.id;
       document.wwv_flow.f25.disabled = false;
    else { // Having multiple records
       for (var i = 0; i < l; i++) {
                document.wwv_flow.f25.disabled = false;
    varad
    Edited by: varad acharya on Apr 22, 2011 6:27 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Multiple form fill-ed's open at one time - crashing

    I have many form fill-ed documents created using Live Cycle.   Issues have been reported regarding adobe shutting down in the middle of filling out a form.  Tow of our employees have this crashing issue.  They both have Windows 7; Adobe Reader XI, and IE X.  I have trouble shooted several different options.  I have used the acrobat_ittools_cleaner to remove old acrobat (recommended by acrobat). 
    I had the Two employees use one form fill at a time to determine the cause of the crashing.  If they use only ONE form at a time, there is not crashing.  The minute they open two forms, and start to fill in the form, it crashes. 
    These forms are not new,  They worked fine with mulitple forms open in the past.  I created these forms in Live Cycle (which came with Acrobat Pro 9).  I figured with the added security in Acrobat XI, I needed to update the forms using Live Cycle Designer ES4.  That did not help either.
    What else can I do to correct this problem?    

    Maggie,
    There are some things you need to consider:
    &lt;script language="JavaScript" type="text/javascript">
    function f_mass_update()
    var counter = 0;
    for (var i = 0; i &lt; document.wwv_flow.f03.length; i++)
    {var curr_id = document.wwv_flow.f03.id;
    if ($x(curr_id).value == 'COMPLETE')
    {$x(curr_id).value = 'CANCELED';
    $x(curr_id).style.color = "darkred";
    $x(curr_id).style.fontWeight = "bold";
    $x(curr_id).style.background = "yellow";
    $x(curr_id).style.width = "103px";
    counter = counter + 1;}}
    if (counter == 0)
    {alert ('There are no more statuses to change!');}
    else {alert(counter + ' Records updated!');}
    &lt;/script>is the correct script if you escape COMPLETE as 'COMPLETE' and CANCELED as 'CANCELED'. The same rules apply for javascript as for the most other programming languagas - numbers do not need to be escaped but character strings do.
    The second thing is the question of your tabular form id. In my case it was f03 but in your case it is probably different. If you created a wizard tabular form and didn't touch it, you could count the columns.
    If your column is the first editable column than it will be f03. The second will be f04 and so on. My recomendation is to use Firefox and download the extension Firebug. With firebug you can do HTML > Inspect and go with the mouse over any element on your page. Click on the actual tabular form cell and it will show you some code like this:
    &lt;input type="text" id="f03_0001" value="10" maxlength="2000" size="16" name="f03"/>so, the name of the element is f03.
    See the same page, now with an image attached of what I just explained:
    http://apex.oracle.com/pls/otn/f?p=31517:213
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Apex 4.0 Collection Error

    Hello All
    I have a report created on collection here is the code:
    On Fetch Process before header:
    if NOT APEX_COLLECTION.COLLECTION_EXISTS (p_collection_name => 'EMP' ) then
    APEX_COLLECTION.create_collection(
    p_collection_name => 'EMP');
    EXECUTE IMMEDIATE 'SELECT COUNT(EMP_ID) FROM '||:FY_SCHEMA||'.EMPLOYEE WHERE COMP_ID = '|| :P152_COMP_ID INTO emp_cnt;
    FOR i IN 1 .. emp_cnt
    loop
    APEX_COLLECTION.ADD_MEMBER(
    p_collection_name => 'EMP',
    p_c001 => i);     
    end loop;
    apex_collection.reset_collection_changed ('EMP');
    end if;
    Report Query:
    SELECT SEQ_ID,c001, c002 FROM APEX_COLLECTIONS WHERE COLLECTION_NAME = 'EMP'
    From one of the column in this report I am calling a javascript function where I am doing to sum of that column.
    It works fine when there are more than one rows, but when there is only one row it is not calculating the total of the column.
    After doing some R & D, I found that, in case of one row the length of wwv_folw.f01 item is coming as undefined(see the comment in js code).
    Here is my javascript function:
    function total_sal(){
    pRow = 1;
    var total = 0;
    var salary;
    var i;
    var val1;
    alert(document.wwv_flow.f01.length); *// here it is showing undefined in the popup*
    for(i=0;i<document.wwv_flow.f01.length;i++){
    salary = document.wwv_flow.f03.value;
    if(salary != ''){
    total = total + parseInt(salary);
    else{
    break;
    document.getElementById('P152_TOTAL').value = total;
    Please tell me where I am going wrong
    I have one more question with regards to interactive report,
    I have given format mask for some columns from edit columns, but it is not showing in that format at the front end.
    Is there any other way for that?
    Thanks
    Tauceef
    Edited by: Tauceef on Oct 9, 2010 4:21 AM

    Hi,
    wwv_flow is pl/sql package and I think you can not use it in javascript.
    You can do something like
    function alertF3(){
    var f1=new Array();
    var f3=new Array();
    f1=document.getElementsByName("f01")
    f3=document.getElementsByName("f03")
    for(i=0;i<f1.length;i++){
      alert(f3.value)
    Edited by: jarola on Oct 9, 2010 10:08 AM
    Sorry, wwv_flow is also form name so this should work alsofunction alertF3(){
    var f1=new Array();
    var f3=new Array();
    f1=document.wwv_flow.f01;
    f3=document.wwv_flow.f03;
    for(i=0;i<f1.length;i++){
    alert(f3[i].value)

  • CSV output - question to Vikas

    Hello Vikas,
    I noticed a funny thing. If I go to one of your reports:
    http://htmldb.oracle.com/pls/otn/f?p=24317:54
    there I can download the report - .csv. It is strange, that this file opens in excell as an excell file and not as a clasical .csv file separated by semicolon. How does this happen? Could you tell me if there is anything you did to achive this?
    I don't like saving .csv file, opening excell and then opening the file to get it readable in excell format....
    I have been trying this with numerous reports since a while but without success. Seaching in this forum I couldn't find anything.
    Denes Kubicek

    Vikas,
    I tryed both comma and semi-colon and still have all values in the first Excel column.
    Under data section I also have javascript code:
    <script type="text/javascript">     
    var rowStyle = new Array(10)     
    var rowActive = new Array(10)     
    var rowStyleHover = new Array(10)     
    rowStyle[1]=''     
    rowStyleHover[1]=''     
    rowActive[1]='N'     
    rowStyle[2]=''     
    <cut>
    rowStyle[97]=''
    rowStyleHover[97]=''
    rowActive[97]='N'
    function checkAll(masterCheckbox) {
    if (masterCheckbox.checked) {          
    for (var i = 0     i<document.wwv_flow.f01.length     i++) {
    if (document.wwv_flow.f01.checked==false) {          
    document.wwv_flow.f01[i].checked=true          
    highlight_row(document.wwv_flow.f01[i],i)          
    } else {          
    rowsNotChecked=0          
    for (var i = 0     i<document.wwv_flow.f01.length     i++) {
    if (document.wwv_flow.f01[i].checked!=true) {          
    rowsNotChecked=rowsNotChecked+1          
    if (rowsNotChecked==0) {          
    for (var i = 0     i<document.wwv_flow.f01.length     i++) {
    if (document.wwv_flow.f01[i].checked==true) {          
    document.wwv_flow.f01[i].checked=false          
    highlight_row(document.wwv_flow.f01[i],i)          
    function highlight_row(checkBoxElemement,currentRowNum) {          
    if(checkBoxElemement.checked==true) {          
    for( var i = 0     i < checkBoxElemement.parentNode.parentNode.childNodes.length     i++ ) {
    if (checkBoxElemement.parentNode.parentNode.childNodes[i].tagName=='TD') {          
    if(rowActive=='Y') {          
    rowStyle[currentRowNum] = rowStyleHover[currentRowNum]          
    } else {          
    rowStyle[currentRowNum] = checkBoxElemement.parentNode.parentNode.childNodes[i].style.backgroundColor          
    checkBoxElemement.parentNode.parentNode.childNodes[i].style.backgroundColor = ''          
    rowStyleHover[currentRowNum] = ''          
    } else {          
    for( var i = 0     i < checkBoxElemement.parentNode.parentNode.childNodes.length     i++ ) {
    if (checkBoxElemement.parentNode.parentNode.childNodes[i].tagName=='TD') {                                
    checkBoxElemement.parentNode.parentNode.childNodes[i].style.backgroundColor = rowStyle[currentRowNum]          
    rowStyleHover[currentRowNum] = rowStyle[currentRowNum]          
    document.wwv_flow.x02.checked=false          
    </script>     

  • Submit a page , close a page and pass values to other page

    Hi All,
    I have page , which has a text box P2_TEST
    I will click on a link on page 2, then a pop up page( page number 3) will appear . Its done using javascript.
    The popup page, has a OK button.
    Whenever I click on OK button,
    1)page 3 has to be closed.
    2)P2_TEST has to be populated with P3_TEST Value. ( P3_TEST is a text field in page 3)
    3)Cursor Should come back to P2_NAME
    which is some other field in Page 2.
    How do do this?
    Thanks in advance.
    Archana

    Thanks Tim.
    I could solve the problem using javascript.
    I have used the following javascript.
    <script>
    function test(){
    var radioLength = document.wwv_flow.p_v01.length;
    var retVal = '';
    if(radioLength == undefined)
              if(document.wwv_flow.p_v01.checked)
                   retVal = document.wwv_flow.p_v01.value;
              else
                   return "";
         for(var i = 0; i < radioLength; i++) {
              if(document.wwv_flow.p_v01.checked) {
                   retVal = retVal + ';' +document.wwv_flow.p_v01[i].value;
    retVal = retVal.substring(1, retVal.length);
    opener.document.getElementById('P1_TEST').value = retVal;
    window.close();
    </script>
    Now the problem is solved!!
    Thanks,
    Archana

Maybe you are looking for