Difference between revisions of "JavaScript on Lookup Page"
From All n One's bxp software Wixi
Philip Lacey (talk | contribs) |
Philip Lacey (talk | contribs) |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 13: | Line 13: | ||
1. Hiding fields | 1. Hiding fields | ||
| − | It is now possible to hide lookup fields to allow the users only enter data on particular fields. This can be very useful if you use a lot of JavaScript on your main campaign as well. | + | It is now possible to hide lookup fields to allow the users only enter data on particular fields. This can be very useful if you use a lot of JavaScript on your main campaign as well. To hide a field |
| − | |||
| − | |||
| − | To hide a field | ||
| − | |||
<syntaxhighlight lang="javascript"> | <syntaxhighlight lang="javascript"> | ||
document.getElementById('tableid_7').style.display = 'none'; | document.getElementById('tableid_7').style.display = 'none'; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| + | |||
2. Validation of input | 2. Validation of input | ||
| Line 38: | Line 35: | ||
The JavaScript is added the same way as you would use onLoad | The JavaScript is added the same way as you would use onLoad | ||
| − | Main Menu > | + | Main Menu > Form Management > Primary Details > Form - Edit > Select the campaign > In the JavaScript onLoad section > Lookup code execution |
In this box you can place your custom JavaScript and it will only be put onto the page on the JavaScript lookup page. | In this box you can place your custom JavaScript and it will only be put onto the page on the JavaScript lookup page. | ||
| + | |||
| + | |||
| + | [[Category:Module Specific:Form Management]] | ||
| + | [[Category:Topic:bxp API]] | ||
| + | [[Category:Topic:JavaScript]] | ||
Latest revision as of 21:46, 9 November 2014
1 Introduction
When doing a lookup for any database in BE, the lookup page dynamically generates all of the fields and uses them as part of the search criteria IF they are filled in.
We have extended the lookup page to allow our users to add custom JavaScript to the Lookup Page. This allows for a number of useful enhancements to be added to the lookup fields.
2 Uses
1. Hiding fields
It is now possible to hide lookup fields to allow the users only enter data on particular fields. This can be very useful if you use a lot of JavaScript on your main campaign as well. To hide a field
document.getElementById('tableid_7').style.display = 'none';
2. Validation of input
You can now prompt users based on their input before they go on to search.
3. Colouring
You can back colour any of the search fields as you wish using JavaScript.
3 How do you set this up?
The JavaScript is added the same way as you would use onLoad
Main Menu > Form Management > Primary Details > Form - Edit > Select the campaign > In the JavaScript onLoad section > Lookup code execution
In this box you can place your custom JavaScript and it will only be put onto the page on the JavaScript lookup page.