Rearranging fields after hidding them

With simple Javascript we are able to hide fields from a form. However,
the fields which are still shown on the form are not realligned. For
example we might have the following scenario:

Field 1
Field 2
Field 3

Field 2 should not be shown on certain conditions. So, in the onLoad()
event of the form we hide this field. This will result in the
following:

Field 1

Field 3

With an empty space between Field 1 and Field 3.

Is there a way to bypass this issue ?

Thanks

Nicos Papaioannou

0
papaioannoun
8/24/2006 6:31:51 AM
crm 35858 articles. 1 followers. Follow

3 Replies
570 Views

Similar Articles

[PageSpeed] 36

There's no automatic way of doing this.

You can try this:

var td2 = document.getElementById(crmForm.all.field2.id + "_d");
var td3 = document.getElementById(crmForm.all.field3.id + "_d");

td2.swapNode(td3);

HTH,
R.


"papaioannoun@dotcy.com.cy" wrote:

> With simple Javascript we are able to hide fields from a form. However,
> the fields which are still shown on the form are not realligned. For
> example we might have the following scenario:
> 
> Field 1
> Field 2
> Field 3
> 
> Field 2 should not be shown on certain conditions. So, in the onLoad()
> event of the form we hide this field. This will result in the
> following:
> 
> Field 1
> 
> Field 3
> 
> With an empty space between Field 1 and Field 3.
> 
> Is there a way to bypass this issue ?
> 
> Thanks
> 
> Nicos Papaioannou
> 
> 
0
Utf
8/24/2006 7:21:01 AM
Yes, you can hide an entire row. The following will do it for you:

//the field you want to hide
var field = crmForm.all.name;

//search the enclosing table row
while ((field.parentNode != null) && (field.tagName.toLowerCase() != "tr")) 
{
    field = field.parentNode;
}

//if we found a row, disable it
if (field.tagName.toLowerCase() == "tr") {
    field.style.display = "none";
}

-- 
Michael

http://www.stunnware.com/crm2

----------------------------------------------------------

<papaioannoun@dotcy.com.cy> schrieb im Newsbeitrag 
news:1156401111.314481.106390@75g2000cwc.googlegroups.com...
> With simple Javascript we are able to hide fields from a form. However,
> the fields which are still shown on the form are not realligned. For
> example we might have the following scenario:
>
> Field 1
> Field 2
> Field 3
>
> Field 2 should not be shown on certain conditions. So, in the onLoad()
> event of the form we hide this field. This will result in the
> following:
>
> Field 1
>
> Field 3
>
> With an empty space between Field 1 and Field 3.
>
> Is there a way to bypass this issue ?
>
> Thanks
>
> Nicos Papaioannou
> 


0
Michael
8/24/2006 7:38:14 AM
Hi Citrine,

Hiding a single field is much easier:

crmForm.all.<fieldname>_c.style.display = "none"; //hides the label
crmForm.all.<fieldname>_d.style.display = "none"; //hides the field


-- 
Michael H�hne, Microsoft Dynamics CRM MVP

Web: http://www.stunnware.com/crm2
Feed: http://www.stunnware.com/crm2/atom.aspx
Custom Lookup Dialog: http://www.stunnware.com/crm2/?area=customLookup

----------------------------------------------------------

"Citrine" <Citrine@discussions.microsoft.com> schrieb im Newsbeitrag 
news:D25B2C5C-4FF3-4F5A-964F-509B4080085A@microsoft.com...
> Hi Michael,
>
> But if you are using a two column layout, how can you hide only the field 
> in
> the first column without affecting the fields on the second column? The
> problem with hiding the row approach is that it hides the field on the 
> second
> column as well.
>
> Let me know.
>
> "Michael H�hne" wrote:
>
>> Yes, you can hide an entire row. The following will do it for you:
>>
>> //the field you want to hide
>> var field = crmForm.all.name;
>>
>> //search the enclosing table row
>> while ((field.parentNode != null) && (field.tagName.toLowerCase() != 
>> "tr"))
>> {
>>     field = field.parentNode;
>> }
>>
>> //if we found a row, disable it
>> if (field.tagName.toLowerCase() == "tr") {
>>     field.style.display = "none";
>> }
>>
>> -- 
>> Michael
>>
>> http://www.stunnware.com/crm2
>>
>> ----------------------------------------------------------
>>
>> <papaioannoun@dotcy.com.cy> schrieb im Newsbeitrag
>> news:1156401111.314481.106390@75g2000cwc.googlegroups.com...
>> > With simple Javascript we are able to hide fields from a form. However,
>> > the fields which are still shown on the form are not realligned. For
>> > example we might have the following scenario:
>> >
>> > Field 1
>> > Field 2
>> > Field 3
>> >
>> > Field 2 should not be shown on certain conditions. So, in the onLoad()
>> > event of the form we hide this field. This will result in the
>> > following:
>> >
>> > Field 1
>> >
>> > Field 3
>> >
>> > With an empty space between Field 1 and Field 3.
>> >
>> > Is there a way to bypass this issue ?
>> >
>> > Thanks
>> >
>> > Nicos Papaioannou
>> >
>>
>>
>> 


0
Michael
1/17/2007 9:48:07 PM
Reply:

Similar Artilces:

Forms; Autonumber and number fields
I have this problem whereby I can't link an autonumber field from a form to another form having a number field. Currently I have coded the codes below for a String expression but I'm not sure on how to execute on autonumber and number. Anyone can help? Private Sub Findings_Click() Dim strOpenArgs As String Dim strCriteria As String Dim strFormName As String On Error GoTo Proc_Error strFormName = "Findings" strCriteria = "[CR Number] = '" & Me![CR Number] & "'" strOpenArgs = Me![CR Number] DoCmd.OpenForm strFormName, WhereCondition:=strC...

Choosing additional export fields
I want to add "Date Sent" and "Date Received" fields to the export file from my Outlook Inbox. How do I do that? Thanks. ...

rearrangement
is it possible to rearrange the serial numbers automatically in office 2003 What serial numbers and in which product of Office 2003? More detailed information needed to answer your question. -- Jerry Whittle, Microsoft Access MVP Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder. "vishwanath" wrote: > is it possible to rearrange the serial numbers automatically in office 2003 On Tue, 26 Jan 2010 06:41:02 -0800, vishwanath <vishwanath@discussions.microsoft.com> wrote: >is it possible to rearrange the serial numbers automatically in o...

Field Not Printing
I have a field that is just not printing. The report feeds from a form, there is a "ContactPhone" field that shows on the form, and when I preview the report, it shows on the screen, but when it's printed out, it doesn't print...it's blank...just that field. Thank you in advance for any help, Gee What about paper size and margins? Is it printing outside you paper or margin? Check file\page setup -- Milton Purdy ACCESS State of Arkansas "Gee" wrote: > I have a field that is just not printing. > The report feeds from a form, t...

The Optional From field
Many our users can send "from:" many other of our other users, simply by enabling the optional "from:" field and entering a valid domain email account, while many others cannot. It seems random. Is there a utility to help diagnose the permissions MANY users have set in their outlook clients or some way to diable the From field. I am also open to suggestions. The user that can would have the 'Send As' right given to them for that particular mailbox. I don't know of a specific tool to use to find this but you can scan a few accounts to see if there is a co...

Custom Fields in Project 2007
In Enterprise Project 2007, is it possible to add additional custom fields? Currently i can see 10 cost fields and 20 number fields and would like to add more -- GDD Gary D -- Your question sounds like Project Server; if so, please post your future questions in the microsoft.public.project.server newsgroup, as this newsgroup is dedicated to the Microsoft Project desktop application only. In Project Server, the administrator does not create custom enterprise fields in Project Professional 2007. Instead, he/she creates custom enterprise fields using the PWA interface, and ...

Calculated Field in Pivot Table #3
Hi I am building a Pivot Table to create projections for sales figures based on previous sales. I have added a calculated field that uses the following If function: =3DIF('Previous Year'<=3D1000000,'Previous Year'*1.12,'Previous Year'*0.98) this works fine, however the subtotals for each product (some products have 2 sizes available) are using the If test and not adding the actual values together. This is an example of my results: Row Labels Next Year Blance Latte R2,270,495.97 (total for Blance Latte) 50 R2,270,495.97 (Ca...

How to Disable Compulsory Fields
Hi Ive just started to play about with CRM and need to disable a compulsory 'Name' field in a new entity. I dont need it at all and cant use it for anything else. Do I use the forms onLoad event to put garbage in it? Although even then its displayed and ideally I just want it gone. Every custom entity has a primary field. It is used as the display name when referencing your entity in a lookup control. When you create a new entity you will see two tabs. The first tab contains the name, display name, display collection name and so one. The second tab (usually overseen), defines t...

Dynamic Text Fields
Can publisher be linked to a database? Let's say I have some research article that needs to be constantly updated (weekly). 90% remains the same for the text, but numbers change. I need it to link to some sort of data source where my data & % changes updates automatically. The only text change would be something like Decrease/Increase, stronger/weaker, better/worse, etc. What software do you recommend for this? Do you think a reporting tool would be more appropriate? Please advise. Derik ...

Update Avg Field
I have form with Bowlers ID, Bowlers, Name and Avg Points field. On a sub form it shows all the tournaments the bowler has competed in and at the bottom averages out the points he has earned over the events entered. I then want to ave points to be updated in the original form, or even better would be for it to update the Ave Pts field in the bowlers table. How can i get this to happen. the two forms involved are Bowlers Pts (Main Form), Sub Form - Bowlers Query subform. The solution here is to remove the [Avg Points] field from your table. Instead, have Access calculate the value wh...

Adding fields to Requisition Management
Hi is it possible to add fields (textbox and attachment) to Requisition line and header in Business Portal 3.0. I have installed the SDK and Rational XDE along with VS.NET. Just need some pointers on making this customization..i am sure there is some kindofa hack here. I have a customer waiting and i need to decide between Requisition Management using Business Portal or building a web application from scratch (or if someone can point out if there is already an application which can be customized - i need to build an RFQ - Request for Quotation system as well). Would really appreciate a tim...

Merging photo fields in Publisher
Thanks in advance. I am a teacher, trying to create a monthly "Student of the Month" publication that includes student photos. The info is all in my Access Database, but I need to put out a monthly publication with pictures of a student from each class (about 26 photos) who earned the "Student of the Month" designation. I am using Publisher to do a catalog merge with my Access database. One of the fields I really need is a photo field. I have tried to follow the directions about putting links in for the photos, but no matter what I do, the actual pictures do not s...

Address State Field
I have a client that has a need to make the address state field a drop down so that they can run reports off of it. Is there any way to do this? The only way I thought of was by creating a new field with a drop down. Any ideas would be appreciated..... Thanks! -- Tara Sifuentes, CCDA, CCNA Hi, We always create a new drop down field for Stateorprovince and we write a script in "onchange" on the properties --> Event of this new field. The code update the original field and you don't need to change all of your reports. the only thing is you need to keep the original f...

save text field w/ leading zeros in .csv format & not lose zeros?
I currently have a csv file with a field that has one digit numbers. I need to create a text field and convert the one digit number to two digit text by adding a leading zero. I have tried using the concatenate function to add the leading zero, but when I close the csv file, it reverts back to one digit. How can I get the file to save the field as text and include the leading zero? Check your CSV file in Notepad, not in Excel. Excel will frequently convert your text representation of a number into a number, even though it likely was written out to disk with the leading zero "...

Saving Calculation Fields Value
hi.. im having a hard time making a database system using only full access.. im not allowed to use any VBA codes.. now im having difficulty on calculation fields in a form.. it is said that calculation fields are not stored in a table.. my question is how can i get the value of that field if ever i have to create another form where i need its existing value.. it would be if easy i can find it in a table but like i said it only exist in the form. please help me with this.. thanks.... -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-forms/2007...

Separating strings in a field to separate fields
Hi, I have a field that consists of a string value that looks like Item1, Item2, Item3, each item is separated by commas. I want to separate that string value so that each item has its own field. Is there code that will easily do this? Thanks, Jaime On Wed, 5 Dec 2007 12:08:57 -0800 (PST), jseger22@yahoo.com wrote: >Hi, > >I have a field that consists of a string value that looks like Item1, >Item2, Item3, each item is separated by commas. I want to separate >that string value so that each item has its own field. Is there code >that will easily do this? > >Thank...

How to specify default "From" field
To All: I have Exchange 2003 with my clients using Outlook 2003. Some users are members of a distribution group sales@domain.com. In Outlook for these users, I want the From field to default to this e-mail address. How do I do it? Regards, Russ You would need to set their default address in the ADUC on the server. However, I don't think it will let you use that address for more than one user - an alternate method is to give the users send as rights - they would need to type the address in the from field though. Another way is to create an IMAP account (so mail is left always on s...

Create Report using fields from Form's datasheet
I have a form in datasheet view and I have a control that allows me to view and hide various fields. I would like to be able to click a button to create a report for printing using the fields that are visible on the datasheet. I don't need to be able to save the report for later use. I'd like it to open the report in layout view so I can edit field sizes and what not to ensure the report fits on one page (usually). Thanks again! I would just push the data to Excel. -- Duane Hookom MS Access MVP "Gntlhnds" <Gntlhnds@discussions.microsoft.com>...

REARRANGING PAGES
i HAVE CREATED A SIX PAGE DOCUMENT, BUT I NEED TO MOVE THE PAGES AROUND. PLEASE HELP Please turn cAPS lOCK off, and tell us which version of Publisher you are using. -- Ed Bennett - MVP Microsoft Publisher http://www.mvps.org/the_nerd/ Before reading this message, view the disclaimer: http://mvps.org/the_nerd/disclaim.htm Hi SHELL (anonymous@discussions.microsoft.com), in the Microsoft� newsgroups you posted: || i HAVE CREATED A SIX PAGE DOCUMENT, BUT I NEED TO MOVE THE || PAGES AROUND. PLEASE HELP Please help us help you: 1. Don't use all caps when posting 2. Please tell us wh...

Outlook 2002 Contact Phone Number Field Formatting
Why don't phone numbers entered in the phone number contact fields on Outlook 2002 automatically format to include the paren's and hyphens? If this is suppose to happen, what is the setting to make it happen? They do here and always have. What are you seeing? --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. After searching google.groups.com and finding no answer mike <michael.kelner@fmr.com> asked: | Why don't phone numbers entered in the phone number | contact fields on Outlook 2002 automatically format to | include th...

Linking Outlook fields from the "Contact Folder" to a custom form in Outlook...
Using Exchange Server 2003/Outlook 2003, we have created a custom Help Desk form in Outlook. We would like the ability to link specific fields from the Contacts Folder (Example B), in a drop-down list box if possible. We are far from knowing that something like this is even possible. Would appreciate *any* suggestions. Thank you. ...

Pivot Table
Hi My data in table are very simply organised as below: --------------------------------------------- Res.no City Code Var1 Var2 Var3 --------------------------------------------- 1 City1 CD0001 num num num 2 City1 CD0002 num num num 3 City1 CD0003 num num num 4 City1 CD0004 num num num 5 City1 CD0005 num num num 6 City2 CD0006 num num num 7 City2 CD0007 num num num 8 City2 CD0008 num num num 9 City2 CD0009 num num num 10 City3 CD0010 num num num 11 City4 CD0011 num num num 12 City3 CD0012 num num num 13 City3 CD0013 num num num 14 City3 CD0014 num num num 15 City1 CD0015 num nu...

shortest path to "link child fields" property
Hi In FormOpen event of a subform I want to use the "linked child fields" property of the "subform control" that contains the subform. The only way I see this is: for each ctl in subform.parent.form if ctl.controltype = acsufform then if subform.name = ctl.form.name then FOUND Is there a shorter way to do this? Riyaz How about Me.Parent.Form.<nameofsubformcontrol>? Carl Rapson <riyaz.mansoor@gmail.com> wrote in message news:1178703926.581738.244140@l77g2000hsb.googlegroups.com... > > Hi > > In FormOpen event of a subform I want...

What is the SystemUserBase
We've got 3 crm environments all with their own domains - live, test and dev. I'm investigating why we cant add users from our main(live) domain to the dev environment, and can't edit existing users from the live domain on the dev domain I've noticed a field on the SystemUserBase table called ActiveDirectoryGUID. My first impression was that it was the id of the relevant AD account, however the live guid for my crm account is different from the ActiveDirectoryGUID on my test crm account, and both records work fine. Whereas the ActiveDirectoryGUID on dev (which has problems) is ...

Freeze Graph size when hidding rows.
Hi guys.. I have a tabel with aprox 50 rows, and i have to hide some of them (when valeu = 0). When i do this the graph that i have in "front" of this rows shrinks!!! How can i freeze the Graph??? Can i give "give" a fixed size to the graph, via macro, after o hide those rows??? I hope i made my self clear... :-) Thanks a lot! SpeeD72 Bill - Don't forget, you have to Shift-Click on the chart first, to select the chart object. It's the chart object that has the Properties tab in its Format dialog. - Jon ------- Jon Peltier, Microsoft Excel MVP http://w...