This topic is locked
[SOLVED]

 frmAdmin1.a.value in 5.3

11/30/2010 11:48:36 AM
PHPRunner General questions
F
FreddieM author

Has this been removed? I use this in some of my projects to loop through a list of selected records and perform actions.
Thanks

Sergey Kornilov admin 11/30/2010

FreddieM,
here are a few examples of how it works in PHPRunner 5.3:

http://xlinesoft.com/phprunner/docs/update_multiple_records.htm

http://xlinesoft.com/phprunner/docs/email_to_selected_users.htm
The old method of using form fields directly won't work.

F
FreddieM author 12/1/2010

Thank for this.
What I used to do is have a button which launched a popup (which was an external php file). In this popup you could enter the information you needed and on submit it would do:
parent.document.frmAdmin1.a.value='copy-'+document.getElementById(\'reference\')
Is there any way of replicating this?

J
Jane 12/1/2010

Hi,
here is a sample button:

<input type=button class=button value="button test" id=custom_button1 name=custom_button1 >



and sample code how to submit form or change value of 'a' element in the JavaScript onload event on the Eventstab:

var submitUrl = this.shortTName+"_"+this.pageType+".php";

if (typeof id == "undefined"){

id = this.id;

}

pageObj = this;

$("#custom_button1").unbind("click").bind("click", function(e){
var selBoxes = $('input[@type=checkbox][@checked][@id^=check'+id+'_]');
if(selBoxes.length == 0 || !confirm('Do you really want to do something with selected records?')){

return false;

}
var form = new Runner.form.BasicForm({

standardSubmit: true,

submitUrl: submitUrl,

method: 'POST',

id: pageObj.id,

baseParams: {"a": document.getElementById('reference').value},

addElems: [selBoxes]

});
//submit form if needed

form.submit();

//open window here if needed

form.destructor();

});
F
FreddieM author 12/2/2010

Yeh thanks for that. With a bit of tweaking managed to get it working.