Welcome to the nuBuilder Forums!

Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.

hash value in html

Questions related to customising nuBuilder Forte with JavaScript or PHP.
Locked
johan
Posts: 422
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: 4562
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 76 times
Been thanked: 528 times
Contact:

Re: hash value in html

Unread post by kev1n »

johan
Posts: 422
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: 4562
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 76 times
Been thanked: 528 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: 422
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: 4562
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 76 times
Been thanked: 528 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: 422
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: 2829
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 30 times

Re: hash value in html

Unread post by admin »

.
Locked