HTML Ebase And Buttons

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

selbjx
Ebase User
Posts: 22
Joined: Fri Jun 06, 2008 8:35 am

HTML Ebase And Buttons

#1

Postby selbjx » Fri Jun 06, 2008 8:52 am

I am using complex html and javascripts in a component.

What i need to know is whether or not there is anyway to get the element ID of a button.

Here's what i mean.

I have a button (eBase button) on a component which at run time generates a javascript:submitAB('GRDF.... number number etc');

From my html i have another button/hyperlink that i want to perform the same action on click, to do this i need to know the GRDF number of the button that is generated at runtime.

This would be quite simple if it were just one form, but as the component will be sent across many forms the GRDF number changes form to form. Is there anyway to get this ID by FPL, or javascript.

I have utilised the 'BuildFieldArray' in other javascripts previously to include character countdown on certain fields dependant upon the max character but as there is nothing to identify the button on the form as the name i named it in ebase this won't work.

Any suggestions would be greatly appreciated.
0 x

selbjx
Ebase User
Posts: 22
Joined: Fri Jun 06, 2008 8:35 am

#2

Postby selbjx » Fri Jun 06, 2008 10:17 am

Or an alternate option is to encompass the FPL

goto form FORMNAME [parm1=value1, parm2=value2.......]

into a javascript: function

but i am unsure of how to do this, any suggestions once again?


Found a work around to this, it isn't pretty but it works, if this is ever needed let me know. i can show code
0 x

AJDulk
Ebase User
Posts: 94
Joined: Fri Sep 14, 2007 12:18 pm
Location: The Netherlands
Contact:

RE: HTML Ebase And Buttons

#3

Postby AJDulk » Fri Jun 06, 2008 11:57 am

One possibility I can think of is to assign a class to the button and then find any button with that class in the JavaScript.

To assign a class to a button:
  • 1. Set up a highlight style in your presentation template.
    2. In FPL use the "highlight field <button> [on <page>] <highlight>" function. (Note: underscores seem to be stripped from the highlight style name in the html).
While there is no getElementsByClass function (that I know of) in JavaScript, there are various options available on the internet. Some possibilities that I have found:
0 x

selbjx
Ebase User
Posts: 22
Joined: Fri Jun 06, 2008 8:35 am

#4

Postby selbjx » Fri Jun 06, 2008 12:02 pm

Hi Thanks for your response.

The way i did it was to use the ufs331.js to loop through the fieldArray and look for the button with a maxlength of 996699 (a unique number i know is never going to be used on the system as a max length) and returns a fieldID.

I then called this from FPL in assigning a field some HTML, calling that javascript.

Works pretty ok - i will bare in mind this approach though. thanks for your response.
0 x


Who is online

Users browsing this forum: No registered users and 34 guests