I have this entry form
{exp:safecracker channel="channel_name" return="url/ENTRY_ID" entry_id="{segment_3}" author_only="yes" include_jquery="no" class="nice"}
<label for="title">Week Title</label>
<input type="text" name="title" id="title" value="{title}" size="50" maxlength="100" class="input-text">
<label for="challenge">Select Challenge</label>
<select name="challenge">
<option value=""> -- </option>
{exp:channel:entries channel="channel_name2" username="CURRENT_USER" dynamic="no"}
<option value="{entry_id}">{title}</option>
{/exp:channel:entries}
</select>
...
{/exp:safecracker}
"Challenge" field dropdown returns {entry_id} correctly but not the {title}. {title} params is blank.
Any tips?
You are encountering namespace collision - {title} is populated first by your Channel Entries tag, but then overwritten by SafeCracker, as it's the outermost module tag. {entry_id} will also fail once you're editing an existing entry rather than creating a new one.
Solve this by embedding your Channel Entries tag (a snippet, as suggested by pvledoux, will not help in this case).
Nesting channel:entries in safecracker is maybe not the best way.
You'll probably get better result if you put your channel:entries tag in a snippet.
Related
Radio button checked not working in the partial view. But working in the main view page. also if I use checkbox instead of radio it works fine in the partial view.
Code:-
<label class="radio-inline">
<input type="radio" value="phonetic" name="languageSelector">
<span class="checkmark"></span>Phonetic
</label>
<label class="radio-inline">
<input type="radio" value="bijoy" name="languageSelector">
<span class="checkmark"></span> Bijoy
</label>
<label class="radio-inline">
<input type="radio" value="avro" checked="checked" name="languageSelector">
<span class="checkmark"></span>Avro
</label>
You may be having an issue with the way you're referencing your partial view. There are two ways of doing so:
#Html.Partial("_PartialExample") and #Html.RenderPartial("_PartialExample")
One is written into the HTTP response, the other is rendered as an HTML encoded string. Try both and see if that helps.
Here's more information about what I'm talking about.
https://www.c-sharpcorner.com/UploadFile/ff2f08/partial-view-in-mvc/
I can't seem to find a way to edit the localised strings using the provided template editor , does anyone have any pointers on this ?
For example if I wanted to change the text 'search products' to something else for example... Where/How can I edit the template and its data ?
Thank you
Le Roi
The ugly way to do this:
Edit the template, remove the
<search-control></search-control>
And add a custom text to the input placeholder
<div>
<form action="/Products" class="pull-right" method="get">
<input type="hidden" name="startEditTemplate" value="ProductList">
<div class="form-group has-feedback">
<input placeholder="My Custom Search products" id="pattern" type="search" class="form-control" name="pattern" spellcheck="false">
<button class="glyphicon glyphicon-search form-control-feedback ap-ininput-button"></button>
</div>
</form>
</div>
The bad part about this is that you are now responsible for updating this piece of code and template.
Let's say I have a page with two forms displaying multiple options as below. As it is, bootstrap will allow the user to select two options and pass both fields when the form is submitted.
But I want to force the user to select from one form only, which in my case below means the user can only select a fruit or a drink but not both.
So is there a way to highlight/select only the latest option selected by the user?
I'd like to avoid using scripts if possible.
Thank you for the help.
<form action="/orderfood" method="post" role="form">
<div>
<label>Fruit</label>
<select class="form-control" name="fruit" multiple="multiple">
{{#each food.fruit}}
<option value="{{_id}}">{{food.fruit}}</option>
{{/each}}
</select>
</div>
<div>
<label>Drink</label>
<select class="form-control" name="drink" multiple="multiple">
{{#each food.drink}}
<option value="{{_id}}">{{food.drink}}</option>
{{/each}}
</select>
</div>
</form>
You can add radio buttons to the form and use an event handler to listen on either their changed or theirclick event and show the <select> that matches the currently selected radio button.
I need to have a combobox on my Lotus Notes Page that I open in WEB...
<input list="myList" name="myList">
<datalist id="myList">
<option value="item 1">
<option value="item 2">
<option value="item 3">
<option value="item 4">
<option value="item 5">
</datalist>
<input type="submit">
as option values (list of items) I want to pull data from some Notes view.
Any ideas?
Thanks
Here is how you can do it (just one way)
<input list="myList" name="myList">
<datalist id="myList">
<computed text>
</datalist>
<input type="submit">
And computed text must have a formula (with #DbColumn) that generate options. This code just an example.
You will need to define view_name, column_number and possible database (if the view is in another database).
_col := #DbColumn(""; ""; "All"; 2);
_options := "<option value=\""+_col+"\">";
#Implode(_options; #NewLine)
Here is a result (my view has only 2 values, 'index' and 'test'):
Also keep in mind that there is a limit (64Kb if I remember correctly) for result of #dbcolumn.
You could also do a more advanced solution, if you want a fancy combobox.
Use a jQuery plugin that support Ajax/JSON for the choices, and then create a Lotusscript agent on the server that return the values.
If you look at this presentation you perhaps get some ideas.
I have used that method in some applications, you get nice features like type-ahead, sorting and much more for free there.
I have an expressionengine template for frontend users using safecracker to create entries. ex: http://domain.com/index.php/create. After user creates an entry, the entry can be edited by going to http://domain.com/index.php/create/my_entry where my_entry is the entry user created. My question is can i provide the user an option to clone an entry. What is the best way to clone. I can't think of an easy way to do this.
I haven't tried this, but you could try creating a new template - say, /index.php/clone/ - that you'd link to with the url_title of the entry to be cloned after it (e.g., /index.php/clone/my_entry). Then use a channel:entries tag with url_title="{segment_2}" to get the values of all the existing entry's fields, and nest an {exp:safecracker} tag inside of it?
{exp:channel:entries channel="my_channel" url_title="{segment_2}"}
{exp:safecracker channel="my_channel"}
<input name="title" type="text" value="{title} />
<input name="my_custom_field" type="text" value="{my_custom_field}" />
... etc ...
<input type="submit" value="Submit" />
{/exp:safecracker}
{/exp:channel:entries}
Worth a shot anyway.