Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Feb 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Alternative to RegisterOnSubmitFunction (...) function;

    First of all , greetings to all .

    I opened this topic to see if someone can support me in the following issue .

    I've been using for several years a system which I program processes, which I have no access to the code. On the client side allows me to create forms in which I can use javascript and the system adds the Submit button to the form, which I have no control to.

    Today I am migrating to a new version of the system and I have to develop some forms. A function widely used to perform calculations and also validate information was complex fields : RegisterOnSubmitFunction (...);

    This feature helped me at the time of executing the submit button, perform some function and return false if not validate anything. stopping the form prosesing.

    The problem is that in the new instance no longer uses buttons Input type, but the label <button>

    Before it was as follows :

    Reviewing the source code, the button was so

    Code:
    <input type="submit" name="button" id="button" value="Submit" />
    and the code I entered was inserted into the body

    Code:
    <body> ..
    
    //Here I was programming my form
    
    <SCRIPT type="text/javascript">
    
    function process () {
    .....
    }
    
    RegisterOnSubmitFunction ( process );
    
    < / SCRIPT >
    
    <body>
    But now the button is as follows:


    Code:
    < div class = "x -btn x -btn -blue -button -small x -box- item x -toolbar -item x -btn -default -toolbar -small x - noicon x -btn - noicon x -btn -default- noicon -small- toolbar "style = " border -width: 1px ; border-color : rgb (209 , 209, 209 ) important , display : none ; "id =" button- 1391 ">
       <em id="button-1391-btnWrap">
          <button id="button-1391-btnEl" type="button" class="x-btn-center" hidefocus="true" role="button" AUTOCOMPLETE="off">
             <span id="button-1391-btnInnerEl" class="x-btn-inner" style=""> Next Page < / span >
             <span id="button-1391-btnIconEl" class="x-btn-icon "> < / span >
          < / button>
       < / em >
    < / div >
    And when I try to use RegisterOnSubmitFunction not work

    An alternative method that comes to mind

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,180
    Thanks
    23
    Thanked 603 Times in 602 Posts
    You should submit this question to the author of the script your using. (S)he would know better than us how to use his creation. We on the other hand don't even know the name of the program your using.
    Evolution - The non-random survival of random variants.

    "If you leave hydrogen alone, for long enough, it begins to think about itself."

  • #3
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,335
    Thanks
    11
    Thanked 588 Times in 569 Posts
    "RegisterOnSubmitFunction ( process );" can be "button.form.onsubmit=process;" or "document.querySelector('button.x-btn-center').form.onsubmit=process;" if your markup is consistent.
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/5/28) IE7:0.1, IE8:5.3, IE11:8.4, IE9:3.2, IE10:3.2, FF:18.2, CH:46, SF:7.9, NON-MOUSE:32%


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •