Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

hash value in html

Questions related to customising nuBuilder Forte with JavaScript or PHP.
Locked
johan
Posts: 399
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

hash value in html

Unread post by johan »

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?

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

Johan
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: hash value in html

Unread post by kev1n »

johan
Posts: 399
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

Re: hash value in html

Unread post by johan »

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
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: hash value in html

Unread post by kev1n »

What value does the field bl_name contain? A screenshot might help to understand the problem better.
johan
Posts: 399
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

Re: hash value in html

Unread post by johan »

Kevin

bl_name contains the name of the pdf-file on my server
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: hash value in html

Unread post by kev1n »

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

Code: Select all

window.open('myserver/uploads/' + $('#'+p).val());
johan
Posts: 399
Joined: Sun Feb 27, 2011 11:16 am
Location: Belgium
Been thanked: 3 times

Re: hash value in html

Unread post by johan »

works fine thanks.
admin
Site Admin
Posts: 2815
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: hash value in html

Unread post by admin »

.
Locked