Jump to content

Javascript If Else Question


Recommended Posts

I have a search page that passes parameters to a results page. I have the search values coming from  a lookup table or a custom “Allâ€, with no value  if a selection is not made from the lookup.

 

My results page uses the parameters to get the information from a data table. Each cell in the fields of the data table may contain multiple data entries, such as multiple states (AL, GA, FL, etc.) When I select a value from the lookup table it is passed to the results page as a parameter. If a field cell contains the value from the parameter I only want to display the parameter value and not all of the contents of the cell, so I use html to display the value of the parameter. This works fine but--

 

If there is no value in the parameter I want to show the entire contents of the cell.

 

Can someone give me the javascript code necessary to do the following:

 

If parameter “[@Virtual1]†is blank show field contents “[@Field:fieldname]â€

 

Else show parameter “[@Virtual1]â€

 

I have little knowledge of javascript so I would appreciate a detailed response if you can help me.

 

Thanks in advance

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...