how to add hyperlink in Sharepoint online with default value in it? - sharepoint

While creating a list, I want hyperlink column should have default value on it

Test demo:
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script>
$(function(){
$("input[aria-describedby='link']:first").val("http://www.google.com");//link is my column name,yo need to change to yours
})
</script>
link is my hyperlink column name,you need to change it to yours.

Related

let an URL link become clickable after using by formula

Scenario
column A
www.google.com
a
b
c
The url link should be clickable for now, however it's become unclickable after I'm using some formula to combine it. here is the formula I'm using
=CONCATENATE(HYPERLINK(A1,A1),char(10),A2,A3,A4)
output
"www.google.com
abc"
Is there any way to let my URL become clickable after combining some formula?
The HYPERLINK should be outside, since the last thing you need is the link
=HYPERLINK(CONCATENATE(A1,char(10),A2,A3,A4), "title")
Excel snapshot

Hide a SharePoint list column based on the value of another column

I have created columns for a list in SharePoint. Some of the columns are choice columns. When I create a new item, all the columns are visible to be populated with data about the new item.
I need to be able to show/hide certain fields based on the option chosen in one of the choice columns. I have done some research about this but it seems that it is only possible to do this using code. Unfortunately, I don't have access to the code of our SharePoint site or to the SharePoint Designer feature so I was wondering if there is a way to do this using a formula in a calculated column?
Thank you.
Cyrille
To add the JavaScript code to newform page, we don't need using SharePoint designer. We can edit the page in UI and add script editor web part to the page, then add JavaScript code to achieve it. Example code.
<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('nobr:contains("Field1")').closest('tr').hide();
//Show/hide columns based on Drop Down Selection
$("select[title='ChoiceField']").change(function() {
if ($(this).val() != "Other"){
$('nobr:contains("Field1")').closest('tr').hide();
}else{
$('nobr:contains("Field1")').closest('tr').show();
}
});
});
</script>
Refer to: Show / Hide fields based on choice field selection using JQuery in SharePoint
If you don't want to use the code, please use InfoPath to achieve it.
Check this:How to Hide a field on the List form based on another field

How to invoke second page only when click on text item in list

I have report which has two page says page1 and page2. Page1 has list object. When I run the report page1 should display with list column values. when I click any of test item from list column1 then second page should appear. Please can you guide me how to achieve this in cognos report studio.
Thanks in Advance.
I'm assuming you want the page to advance and not a drill-through. You can do this with JavaScript.
This method turns every value into a link that will invoke the next page when clicked:
Unlock the report
Put an HTML Item to the left of your data item that you want to be clicked.
For the HTML Item expression, supply the following code: <a href="#" onclick="advancePage()">
Add another HTML Item to the right of your data item with the following expression: </a>
Add a third HTML Item to the bottom of your report
Supply the following expression for the HTML Item:
JS Code:
function advancePage() {
var report = cognos.Report.getReport('_THIS_');
report.sendRequest(cognos.Report.Action.NEXT);
}
There are other variations. For instance, you could use a button instead of a text link. For all the variations, the essential technique is the same.

How to dynamically change the TableLayout in ext.net 1.x

I have an ext.net page containing a table built by TableLayout. It is similar with the example shown on the official demo site. (link) The only thing different is I have combo box, textbox inside those Cells, not just a bunch of panels.
Now, there is the need to dynamically hide some textboxes based on the selection of a combobox. What I have done is to set up the combobox to AutoPostBack="true" OnValueChanged="comboboxname_OnValueChanged" .
In that code-behind method comboboxname_OnValueChanged, I check the selected value and do a textboxname.Visible="false". Then I got the unexpected: the whole Cell that contains that textbox is removed. And my whole table is messed up!
Then my guess is that the Cell must remain in place to occupy the position. My next try is:
mytablelayout.Cells[5].Clear();
mytablelayout.Cells[5].Add(emptyLabel);
here, the index 5 is the table cell with the textbox I want to hide. and emptyLabel is an ext.Label which displays nothing. Unfortunately it does not work.
My third try is to build an empty cell first. then,
mytablelayout.Cells.RemoveAt(5);
mytablelayout.Cells.Insert(5, emptyCell);
I found RemoveAt(5) can be successfully executed, which again messed up my table because the next cell just moves from its supposed place. But the Insert(5, emptyCell) just never did what I want.
Now I am really at my wit's end. Can any ext.net expert give some advice? How did you manipulate the Cells in a TableLayout?
Thank you for any helpful input.
make a CSS class with display none.
.myClass {
display: none;
}
set the textbox cls property to the CSS class made earlier
textboxname.cls = "myClass";

How to predefine and hide a column in SharePoint NewForm and EditForm?

does anyone know how to predefine a column and hide it in SharePoint? I want to create a second NewForm for an already existing List. A new column with two options will make sure to differentiate the two entries in reports/views.
Example:
I have a list with two columns: Name (text) and Type (choice). I want to make two custom NewForms. Both will only have one editable field and both will have one hidden predefined field.
NewForm number 1 will have the Name column visible and Type selected as Male and hidden.
NewForm number 2 will have the Name column visible and Type selected as Female and hidden.
Is this possible?
Regards,
David
This is how I implemented this :)
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
$('select[title=ColumnName]').val('ValueYouWant');
$("nobr:contains('ColumnName')").parent('h3').parent('td').parent('tr').hide();
});
</script>
It certainly is possible to modify the forms while the user is using them:
You can put the page into edit mode and add a Content Editor Web Part and fill it with javascript to do what you want. Or you can do the same using SharePoint Designer.
As for having more than one NewForm for a single list I don't know.
You can create a new custom NewForm.aspx page by right clicking on the existing page in SharePoint Designer and choosing "New from Existing Page."
As Dan mentioned, you can add JavaScript to your page to hide or default values. An option for you would be to use SPUtility.js (full disclosure.. a JavaScript library I maintain):
SPUtility.GetSPField('Gender').SetValue('Male').Hide();
Call the below function and specify Field Name:
function HideField(FieldName)
{
$('nobr:contains("'+FieldName+'")').closest('tr').hide();
$('td.ms-formlabel:contains("'+FieldName+'")').parent().hide();
}

Resources