hash value in html

Questions related to customising nuBuilder Forte with Javascript or PHP.

hash value in html

Postby johan » Tue Mar 19, 2019 3:01 pm

Hi

In my subform I want to set an html link to my server using the hash value of the field bl_name. Bl_name is part of the subtable
This isn't working. Any idea how to set my url?

[url]<a href="https://myserver/uploads#bl_name">Download</a>[/url]

Johan
johan
 
Posts: 276
Joined: Sun Feb 27, 2011 7:46 pm
Location: Belgium

Re: hash value in html

Postby kev1n » Tue Mar 19, 2019 3:20 pm

kev1n
 
Posts: 322
Joined: Mon Oct 15, 2018 2:13 am

Re: hash value in html

Postby johan » Tue Mar 19, 2019 11:33 pm

Kevin
I'm almost there but I know nothing about javascript :(

with
Code: Select all
var p = $(this).attr('data-nu-form') + $(this).attr('data-nu-prefix').slice(-3) + 'bl_name'; window.open($('#'+p).val());

I get url myserver/filename

What i need is myserver/uploads/filename.

Can you help me wth that?
Thanks
Johan
johan
 
Posts: 276
Joined: Sun Feb 27, 2011 7:46 pm
Location: Belgium

Re: hash value in html

Postby kev1n » Wed Mar 20, 2019 12:30 am

What value does the field bl_name contain? A screenshot might help to understand the problem better.
kev1n
 
Posts: 322
Joined: Mon Oct 15, 2018 2:13 am

Re: hash value in html

Postby johan » Wed Mar 20, 2019 12:51 am

Kevin

bl_name contains the name of the pdf-file on my server
Attachments
Selectie_087.png
Selectie_087.png (17.46 KiB) Viewed 504 times
johan
 
Posts: 276
Joined: Sun Feb 27, 2011 7:46 pm
Location: Belgium

Re: hash value in html

Postby kev1n » Wed Mar 20, 2019 1:01 am

So you need to add the 'myserver/uploads/' string (replace with your server of course)

Code: Select all
window.open('myserver/uploads/' + $('#'+p).val());
kev1n
 
Posts: 322
Joined: Mon Oct 15, 2018 2:13 am

Re: hash value in html

Postby johan » Wed Mar 20, 2019 4:08 am

works fine thanks.
johan
 
Posts: 276
Joined: Sun Feb 27, 2011 7:46 pm
Location: Belgium

Re: hash value in html

Postby admin » Fri Mar 22, 2019 11:01 am

.
admin
Site Admin
 
Posts: 3154
Joined: Mon Jun 15, 2009 9:53 am


Return to Custom Code



cron