Parent child relationship field

3 posts by 2 authors in: Forums > CMS Builder
Last Post: February 26, 2013   (RSS)

Hi Ron,

This is something that CMS Builder doesn't currently do. But we've found a solution that uses the default value field. 

If you edit the list field that contains your category field, and add this for the default value:

<?php preg_match('#([0-9]+[^0-9]*)$#', @$_REQUEST['returnUrl'], $out); echo @$out[0]; ?>

you should find that the field will have the correct value selected by default.

So this statement will look in the URL for the returnUrl variable, and then uses preg_match to return the last numbers in the string, which will be the num field. It will return an array of numbers, and the first needs to be displayed. 

Thanks!

Greg

Greg Thomas







PHP Programmer - interactivetools.com

Thanks Greg!

That does work ... somewhat.  I haven't worked with it enough yet to determine where and what the exact problem is, but will attempt to do so shortly and get back with what I find.

Later, and thanks again.  

Ron Conring
Conring Automation Services
----------------------------------------
Software for Business and Industry Since 1987