Ok, This is what i was trying to accomplish; i have a parent with a list of available jobs. If i click on one of the job( say "System Enginner"), it will bring me to another document called "System Enginner". In this document there is a "Apply now" link. If i click on this link it will direct the user to an application form. In the application form, which uses eForm, it has a drop down option, with the list of all the available job position from the parent.
eg
<select>
<option>Manager</option>
<option>System Engineer</option>
</select>
What i wanted to do was to have the option automatically select "System Engineer", based on the previous page i click "Apply Now" link from.
So far i manage to get the ditto to show all the available job position dynamically correctly. But i can’t seems to get it to automatically select the job "System Engineer"
What i did was this;
in the Apply Now link, i added a postid variable of the current document ID;
it will then go to the application form
eg:
http://web/ff/index.php?q=63.html&postid=51
In the application form, i have a snippet that will grab the postid value and put it into $pId. It will also get the ditto [+id+] from the current ditto and put it into $idx. It then compare both value,if it match then it will put a "SELECTED" text into the <option> .
This is the snippet;
<?php
$idx= ’[+id+]’;
$pId= @$_GET["postid"];
if ($pId == $idx){
echo "SELECTED";
}else{
echo "NO";
}
?>
in both variable they seems to be able to retrieve the value correctly. I did an echo on both variable and it show the value correctly in the browser;
but somehow, even thought value of both variable matches, it doesn’t return TRUE.
i did more digging,
and what i notice was the value $idx was acting wierd. For example
if i type
echo $idx;
the value come out correctly eg: 51,
but if i did some maths like this:
echo $idx+100;
the value shows 100 and not 151; its as if $idx value dissappeared and became 0.
So somehow the value for $idx from ditto just dissappear when i try to use it.
Any idea?