This topic is locked
[SOLVED]

 List page get.Value

7/24/2012 6:12:31 AM
PHPRunner General questions
author

Hi
I can use :-
var type = Runner.getValue(pageid, 'type');

to get the value of a field on the add, edit pages on the javascript on load function. Following this code I hide or unhide fields and test.
How can I get the value of the field on the list page so that I only show the relevant fields for each form
Thanks in advance
Richard

C
cgphp 7/24/2012

The right syntax to get the value of a control is the following:

var type = Runner.getControl(pageid, 'type');

var value = type.getValue();


Try to reformulate your question. I'm not sure I understand what you mean when you say:

How can I get the value of the field on the list page so that I only show the relevant fields for each form

7542 7/24/2012

Hi Cristian

(I hope that you are well)
I have an event that on the add and edit pages hides fields using:

$("p[id^='birth']").hide();
or shows fields using

$("p[id^='birth']").show();
I have used this instead of "linked_price_plan.hide();" because I want to hide parts of the form including <P> tags with id's etc
Anyway, this works well on the add, edit pages. But when I load the list page with the following code fails
var type = Runner.getValue(pageid, 'type');
// marriage and death certificates

if (type == "Birth Certificate" || type == "Death Certificate")

$("p[id^='birth']").show();

else

$("p[id^='birth']").hide();
I cannot get the value of Type, Type displays the value Birth Certificate or ...
If I could get the type, I could show or hide field values on the list page along with form values
Thanks in advance

C
cgphp 7/24/2012

Control object allows you to work with the "edit" controls not with list page.

7542 7/24/2012

Hi
Is their any way of getting the value of the form field in javascript?
Regards
Richard

C
cgphp 7/24/2012

Do you want to hide the columns on the list page?

7542 7/24/2012

Yes, dependant on the id of the type field. I cannot use $tx and assign false as I cannot get the data["... attribute on the before display event. If I could this may work. But I also would like to change the text of headings which is why I favoured Javascript.
Ideally I would like to get the field value in Javascript, but anything would work
Thanks
Regards
Richard

C
cgphp 7/24/2012

If it depends on the id of the record, you have to hide the value of the field not the column. You can set the field as Custom and set the value to an empty string.