Get value of element on custom form

leighshayne

New Member
Hi

I would like to be able to return the value of an element so that I can use it to show or hide a certain div on a custom form. I've currently got

PHP:
$this->element =& $this->elements['Records'];[/FONT][/SIZE]
[SIZE=3][FONT=arial]$records= $this->element->element;[/FONT][/SIZE]
           
[SIZE=3][FONT=arial]echo $records;

but this gives me the element wrapped in a div



HTML:
<div id="horse_info___Records_ro">Here's the content I want</div>

How do I just return the element content? If I use the plugin {fabrik view=element list=1 rowid=[rowid] element=horse_info___Name} I cannot use this in the php code I want to execute on the page as it is rendered after the page has loaded.

Any suggestions?
 
Hi there,
though it is not very clear to me what exactly your problem is, i am using this solution:
PHP:
      <?php
      $this->element =& $this->elements['your_elements_name'];
      echo $this->loadTemplate('element');
      ?>

Why do you set the font-size like that? Why dont you style it via CSS?
 
That's weird, not sure where that Font stuff has come from. Its not in my code so must have happened when i put the code in the post. If i use the method you suggest I still get the element wrapped within a div sadly.
 
I'm trying to do something similar. I have a calculated value in an element and I want to access that value as a session variable in another application. Any suggestions would be very appreciated.
 
it isn't the most elegant solution, but I used php substr(); to extract the value, so
PHP:
$this->element =&$this->elements['Name'];
$divname=$this->element->element;
$name=substr ($divname, 31, -6);
 
We are in need of some funding.
More details.

Thank you.

Staff online

Members online

Back
Top