Anchor to another Form

joki94

Member
Hello,

I have one form called rfp_overviews and a second form with the name fab_hotels.

Now I inserted an anchor in the fab_hotels form and need an custom link from the rfp_overviews form to the details view of fab_hotels regarding to the hotelname I wrote in the field rfp_overviews___hotelname.

Means the Link shoud look at the rfp_overviews___hotelname field and oben the fab_hotels details view with the same hotelname inside (fab_hotels___name)

I tried it with this link, but I get an empty details view record.

index.php?option=com_fabrik&view=details&fabrik=2&hotelname={rfp_overviews___hotelname}#benefits

Can you help me how I can do this?

Kind Regards and thanks for your help,

joki94
 
index.php?option=com_fabrik&view=details&formid=2&fab_hotels___id={rfp_overviews___hotelname_raw}#benefits

-- hugh
 
Thanks for your quick reply, but I got the same result. All fields are empty in details view

But the url looks correct: index.php/rfps/details/2?fab_hotels___id=City Partner Hotel Residence#benefits

Hope you can help.

Kind Regards,
joki94
 
Last edited:
Did you include the _raw on the end?

Is your rfp_overviews___hotelname join element using 'id' as the Value? If you are using the _raw pleaceholder and are getting the name instead of an id, then you probably didn't use the 'id' as the value for the join (the one that says "reommended" by it).

-- hugh
 
Hi cheesegrits,

I changed to id and checked again if I used raw at the end, but unfortunately I still get the name in the url and all fields are empty.

I used id as value and name as label, is that wrong?

Kind Regards, joki94
 
I could solve it, after changing back the value to name it ask me to change the databasestructure from var to int. Now it works.

But is there a possibility to directly get the correct id after entering the name in the field rfp_overviews___hotelname so that the link works directly without saving the form first?

Kind Regards,

joki94
 
Did you originally have 'id' as the value? If not, did you re-save your data so the id is saved?

-- hugh
 
We crossed in the post.

Where are you putting the link?

In order to have it change dynamically when you change the hotel selection, it would have to be updated by JavaScript.

Two choices:

1) Put it in a calc element, and enable AJAX calc.

2) If you are putting it in (say) the form intro, or as part of a custom template, you'd have to manage changing it yourself. Add an id to your link, like ...

Code:
<a href="index.php?option=com_fabrik&view=details&formid=2&fab_hotels___id={rfp_overviews___hotelname_raw}#benefits" id="hotelLink">your title</a>

... then add a 'change' (or 'blur') JS event to your hotel name element, which does ...

Code:
getElementByid('hotelLink').href = 'index.php?option=com_fabrik&view=details&formid=2&fab_hotels___id=' + this.form.formElement.get('rfp_overviews___hotelname').getValue() + '#benefits';

-- hugh
 
I did and I also tried to add an calc element which gaves me the id. The id will be updated automatically after a change. That works fine but the link is empty if I not save the form before
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top