This topic is locked
[SOLVED]

 Disable Register Button

4/14/2015 11:47:01
PHPRunner General questions
A
aalekizoglou author

With PHPRunner 8.0 I am trying to disable the "Register" button in register page. The code I am using is:


var SaveButtonID = "saveButton";

var SaveButton = $("[id^=" + SaveButtonID + "]");
if(document.getElementById('terms').checked==true)

Runner.delDisabledClass(SaveButton);

else

Runner.addDisabledClass(SaveButton);


giving me the required result


<a class="rnr-button disabled" href="#" id="saveButton1" type="">Register</a>


But the button even though grayed out, is clickable. Once I click on it it is calling the register.php
Is there something I am missing?

C
cgphp 4/18/2015

You can disable the registration page: registration page

Sergey Kornilov admin 4/18/2015

Here is what you need to do in order to make it work on Register page. Modify file C:\Program Files (x86)\PHPRunner8.0\source\include\common\runnerJS\pages\RegisterPage.js adding the text in bold as follows:

/**

  • Initialize the page's buttons

    */

    initButtons: function() {

    var pageObj = this;
    this.saveButton = $("a[id=saveButton" + this.id + "]").bind("click", function(e) {

    var arrcntrl = Runner.controls.ControlManager.getAt(pageObj.tName),

    button = $(this),

    ctrl, index;
    if ( Runner.isDisabledButton( button ) ) {

    return false;

    }

    button.addClass('disabled')

    pageObj.upploadErrorHappened = false;

    pageObj.fileFieldsCount = 0;

A
aalekizoglou author 4/19/2015



Here is what you need to do in order to make it work on Register page. Modify file C:\Program Files (x86)\PHPRunner8.0\source\include\common\runnerJS\pages\RegisterPage.js adding the text in bold as follows:


Great Sergey,
thanks