2/21/2025 5:00:56 AM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss using & developing the legacy SalesLogix Web Client (For versions 7.0 and earlier). View the code of conduct for posting guidelines.
|
|
|
|
Need help accessing data in javascript
Posted: 21 Nov 06 2:46 PM
|
fiogf49gjkf0d Okay...so I'm new at this and still trying to figure some stuff out. I need to access a field in the database inside my javascript code, is there a way to do this? Here's what I'm trying to do. In the HTML, if I want to access a database field and assign that field to a textbox I do it like this: <td><input type="text" name="blah" value="<#F name=blah>" /></td>. So, want I am trying to do is only add a label if a field has a certain value. How do I drop access that database field inside the javascript? Any help would be most appreciated. |
|
|
|
Re: Need help accessing data in javascript
Posted: 21 Nov 06 11:46 PM
|
fiogf49gjkf0d Corey,
It's actually pretty easy. If you look at the template "accinfo" on line 13, you'll see they've referenced a #SYS tag in JavaScript. You can do the exact same thing with a #FIELD tag.
For example, make a copy of the accinfo template and make the copy active. Then modify the line that reads (should be line 23)
to read
Then just after line 18 that reads: var accid = '<#AF name=id>';
add this function:
function test() { if ("<#FIELD name=accname>" == "Abbott Ltd.") { document.all.ACCOUNT[1].innerText = "Abbott Label"; } else { document.all.ACCOUNT[1].innerText = ""; } }
That function [test();] gets called when the HTML page is finished loading. It should change the label next to the Account name to a blank if the account is not Abbott Ltd. If it is Abbott Ltd., it should read "Abbott Label". Unless I've left something out (it is getting late), that should do it.
If you run into issues, post again and I'll do my best!
Jeff
|
|
|
|
Re: Need help accessing data in javascript
Posted: 21 Nov 06 11:48 PM
|
fiogf49gjkf0d Agh! The forum stripped out my tag (rightfully so...). My references to line 23 should look like this - and I've intentionally left out the opening and closing tags.
Change line 23 from this:
body onload="init();" style="border:0px solid;"
to this:
body onload="init();test();" style="border:0px solid;"
I think the rest came through OK.
Jeff
|
|
|
| |
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|