this is my create function in my controller:
public function actionCreate()
{
$searchModel = new AutoriSearch();
$model = new Autori();
$model->RIDUtente = Yii::$app->user->getId();
$model->Accettazione='SI';
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
if ($model->load(Yii::$app->request->post()) ) {
$model->modified = date( 'y-m-d' );
$model->creator_aut = Yii::$app->user->getId();
$model->Utenteup_autori = Yii::$app->user->getId();
if ($model->IParte) {
$model->CampoRicerca = $model->IParte." ".$model->IIParte." ".$model->Prefisso." ".$model->Qualificazione." ".$model->IIEnte." ".$model->Sigla;
}
if($model->Accettazione == "" || $model->Accettazione == 'SI' ){
$model->RIDAutore = $model->IDAutore;
}
$model->save();
return $this->redirect(['view', 'id' => $model->IDAutore]);
}
return $this->render('create', [
'model' => $model,
'dataProvider' => $dataProvider,
'searchModel' => $searchModel,
]);
}
The problem is that the record is not saved, and the system don't enter in the if function "if ($model->load(Yii::$app->request->post()) )". So this is a problem. In others controller it gives me no error, for this controller it gives me the error. This is strange. Can anyone help me fast please? It's very important!!!! Thank you.
This is the form:
<div class="autori-form">
<?php $form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
'type' => ActiveForm::TYPE_HORIZONTAL,
]); ?>
<?= $form->field($model, 'IParte', ['labelOptions'=>['style'=>'font-size: 12px;']])->textInput(['maxlength' => true, 'style'=>'width:190px; height: 30px;'])->label('I Parte del nome') ?>
<?= $form->field($model, 'IIParte', ['labelOptions'=>['style'=>'position: relative; top: -63px; left: 360px;font-size: 12px;']])->textInput(['maxlength' => true, 'style'=>' height: 30px; width:190px; position: relative; position: relative; top: -58px; left: 360px;'])->label('Autori:<br>II Parte del nome') ?>
<?= $form->field($model, 'IIEnte', ['labelOptions'=>['style'=>'width: 100px; position: relative; top: -120px; left: 800px;font-size: 12px;']])->textInput(['maxlength' => true, 'style'=>' height: 30px; width:190px; position: relative; top: -116px; left: 800px;'])->label('Enti: Ente subordinato') ?>
<div style="position: relative; top: -120px;">
<?= $form->field($model, 'Prefisso', ['labelOptions'=>['style'=>'font-size: 12px;']])->textInput(['maxlength' => true, 'style'=>' height: 30px; width:300px'])->label('Appellativi o altra parte del nome') ?>
<?= $form->field($model, 'Sigla', ['labelOptions'=>['style'=>'font-size: 12px;']])->textInput(['maxlength' => true, 'style'=>' height: 30px; width:300px'])->label('Sigla dell\'ordine') ?>
<?= $form->field($model, 'Qualificazione', ['labelOptions'=>['style'=>'font-size: 12px;']])->textInput(['maxlength' => true, 'style'=>' height: 30px; width:300px'])->label('Qualificazioni') ?>
<?= $form->field($model, 'Fonte', ['labelOptions'=>['style'=>'font-size: 12px;']])->textInput(['maxlength' => true, 'style'=>' height: 30px; width:300px']) ?>
<?= $form->field($model, 'RIDTipoAutore', ['labelOptions'=>['style'=>'font-size: 12px;']])->dropdownList(
TipiAutore::find()
->select(['TipoAutore'])
->indexBy('IDTipoAutore')
->column(),
['prompt'=>'', 'style'=>' height: 30px; width:300px']
)->label('Tipo Autore') ?>
<?= $form->field($model, 'Accettazione', ['labelOptions'=>['style'=>'font-size: 12px;']])->dropdownList(
Autori::find()
->select(['Accettazione'])
->indexBy('Accettazione')
->column(),
['style'=>' height: 30px; width:300px', 'onchange' => 'accettato(this)']
)->label('Accettazione') ?>
<?php //$form->field($model, 'CampoRicerca')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'RIDUtente')->hiddenInput(['value'=> Yii::$app->user->identity->id])->label(false) ?>
<?= $form->field($model, 'RIDAutore', ['labelOptions'=>['style'=>'font-size: 12px; position: relative; top: -28px;']])->textInput(['maxlength' => true, 'style'=>' height: 30px; width:300px; position: relative; top: -28px;', 'disabled' => true])->label('Forma accettata') ?>
</div>
<a name="button" id="btnMostra" style="position: relative; top: -199px; left: 540px; cursor: pointer;">Clicca per ricercare la forma accettata</a>
<script>
function accettato(select) {
console.log(select,$(select));
$("#autori-ridautore").prop("disabled", $(select).val()!="NO");
}
</script>
<?= Html::hiddenInput( 'modified', strtotime("now") ); ?>
<div class="form-group" style="position: relative; top: -170px; left: 860px; width: 200px;">
<?= Html::submitButton(Yii::t('app', 'Salva'), ['class' => 'btn btn-success']) ?>
<?= Html::a('Annulla', ['autori/index'], ['class'=>'btn btn-info']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
RULES OF Autori.php:
public function rules()
{
return [
[['RIDUtente', 'modified', 'RIDTipoAutore'], 'required'],
[['RIDUtente', 'RIDAutore', 'RIDTipoAutore', 'creator_aut'], 'integer'],
[['IParte', 'IIEnte'], 'string', 'max' => 100],
[['IIParte', 'Qualificazione'], 'string', 'max' => 50],
[['Prefisso'], 'string', 'max' => 30],
[['Sigla'], 'string', 'max' => 10],
[['Accettazione'], 'string', 'max' => 2],
[['CampoRicerca'], 'string', 'max' => 400],
[['Fonte'], 'string', 'max' => 3200],
[['modified'], 'string', 'max' => 8],
];
}
RULES OF AutoriSearch Model:
public function rules()
{
return [
[['IDAutore', 'RIDUtente', 'RIDAutore', 'RIDTipoAutore', 'creator_aut'], 'integer'],
[['autoreMix', 'IParte', 'IIParte', 'Prefisso', 'Qualificazione',
'IIEnte', 'Sigla', 'Accettazione', 'CampoRicerca',
'Fonte', 'modified'], 'safe'],
];
}
your forms method is get but you are getting data by post and this is incompatible
'method' => 'get',
$model->load(Yii::$app->request->post()
Related
I am using images in svg format for the first time. and they aren't displayed my project. I tried with png and it works. I also tried changing the size, color etc.. Thank you!
Data file where the images and their title are stored (
I don't think that's the problem because when I replace the links with .jpg pictures, it works)
<?php
namespace App;
class Data{
public static function getSkills()
{
return [
// array data
array("name" => "HTML5", "icon" => '/home/student/Bureau/Portfolio/public/images/skills/bootstrap.svg'),
array("name" => "CSS3", "icon" => 'public/images/skills/css.svg' ),
array("name" => "Sass", "icon" => 'public/images/skills/html5.svg'),
array("name" => "Bootstrap", "icon" => 'public/images/skills/html5.svg'),
array("name" => "JavaScript", "icon" => 'public/images/skills/html5.svg'),
array("name" => "MySQL", "icon" => 'public/images/skills/html5.svg'),
array("name" => "PHP", "icon" => 'public/images/skills/html5.svg'),
array("name" => "React JS", "icon" => 'public/images/skills/html5.svg'),
array("name" => "Redux", "icon" => 'public/images/skills/html5.svg'),
array("name" => "GitHub", "icon" => 'public/images/skills/html5.svg'),
array("name" => "Trello", "icon" => 'public/images/skills/html5.svg'),
array("name" => "VSCode", "icon" => 'public/images/skills/html5.svg'),
array("name" => "Linux Ubuntu", "icon" => 'public/images/skills/html5.svg'),
];
}
}
Controller
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Data;
class SkillsController extends Controller
{
public function index()
{
return view('competences', [
'competences' => Data::getSkills()
]);
}
}
competences.blade.php
#include('layouts/navbar')
<div class="skills">
<h1 class="skills-title text-center"> <span class="the-span "> Compétences </span></h1>
<h2 class="subtitle text-center"> <span class="the-span "> •Les langages, outils et frameworks que j’utilise </span></h2>
<ul class="skills-list text-center m-auto">
#foreach ($competences as $competence)
<li class="skills-list-skill" key="{{$competence['icon']}}">
<embedy src="{{$competence['icon']}}" alt="" class="skills-list-skill-icon" />
<p class="skills-list-skill-title">{{$competence['name']}}</p>
</li>
#endforeach
</ul>
</div>
#include ('layouts/footer')
Scss file
// Variables
#import 'variables';
.skills {
margin-bottom: 10em;
margin: 3em 0 2em 1em;
&-list {
display: flex;
flex-wrap: wrap;
#media screen and (min-width: 1440px) {
width: 60%;
}
#media screen and (min-width: 1024px) {
width: 70%;
}
&-skill {
width: 7em;
#media screen and (max-width: 320px) {
width: 5em;
}
background-color: $second-font-color;
margin: 3em 3em 1em 0;
min-height: 7em;
display: flex;
flex-wrap: wrap;
justify-content: center;
padding: 1em;
border-radius: .5em;
font-size: .8em;
text-align: center;
&:nth-child(odd) {
img {
color: $font-color;
}
}
&:nth-child(even) {
img {
color: $second-font-color;
}
}
&:hover {
transition: .8s;
box-shadow: 0px 0px 20px 2px rgba(255, 255, 255, 0.4);
}
&-icon {
padding: 1em 2em;
width: 40px;
height: 40px;
color : white;
}
}
}
}
I don't know what is <embedy> tag for, you can simply try load your svg icon with img tag
<img src="{{$competence['icon']}}" alt="" class="skills-list-skill-icon" />
also you dont need to add complete address to getaddress method ,you can just add icon name and in code load with asset
<img src="{{asset('/images/skills/'.$competence['icon'].')}}" alt="" class="skills-list-skill-icon" />
I have one div and under that i have kendo grid. I want to give 100% height or auto height to div but when i give that Kendo Grid header is getting long and close that div as in image
But i want to show view like this
I don't want to give fix value to first div element because item detail is different for all detail so it need to be auto.
Here my css & html
<style>
#gauge-container {
text-align: right;
margin: 0px auto;
background: transparent url(#Url.Content("~/Content/linear-gauge-container.png")) no-repeat 50% 50%;
padding: 18px;
width: 100px;
height: 300px;
float:left;
}
.k-gauge {
height: 300px;
display: inline-block;
zoom:1;
}
##media(max-width:768px) {
.div1 {
overflow:auto;
}
}
##media(min-width:768px) {
.div1 {
height:100%;
}
}
</style>
<div class="div1">
#for (int i = 0; i < tanklist.Count; i++)
{
<table>
<tr>
<td><b>Capacity</b></td>
<td>:</td>
<td><b>#tanklist[i].TnkKapasite.ToString("N0", nf) LT</b></td>
</tr>
<tr>
<td>Fuel</td>
<td>:</td>
<td>#tanklist[i].StokKod</td>
</tr>
<tr>
<td>Time</td>
<td>:</td>
<td>#tanklist[i].Time</td>
</tr>
<tr>
<td><b>Fuel Vol.</b></td>
<td>:</td>
<td><b>#tanklist[i].FuelVolume.ToString("N0", nf) LT</b></td>
</tr>
<tr>
<td>Ullage</td>
<td>:</td>
<td>#tanklist[i].Ullage.ToString("N0", nf) LT</td>
</tr>
<tr>
<td>Water Vol.</td>
<td>:</td>
<td>#tanklist[i].WaterVolume.ToString("N0", nf) LT</td>
</tr>
<tr>
<td>Temperature</td>
<td>:</td>
<td>#tanklist[i].Temperature</td>
</tr>
</table>
}
</div>
<div style="height:100%;">
#( Html.Kendo().Grid<Deliveries>()
.Name("grdTank_" + (string)data)
.DataSource(ds => ds
.Ajax()
.Read(r => r.Action("GridBinding", "Dashboards", new { code = data, tip = tip }))
)
.Columns(columns =>
{
columns.Bound(e => e.Tank).Width(80).Title("Tank");
columns.Bound(e => e.StartTime).Width(100).Title("Start Time").ClientTemplate("#= kendo.toString(StartTime, 'dd.MM.yyyy HH:mm:ss') #");
columns.Bound(e => e.EndTime).Width(100).Title("End Time").ClientTemplate("#= kendo.toString(EndTime, 'dd.MM.yyyy HH:mm:ss') #");
columns.Bound(e => e.Fuel).Width(50).Title("Fuel");
columns.Bound(e => e.DeliveredVolume).Width(100).Title("Delivered Volume").ClientTemplate("<div style='text-align:right;'>#= FormatNumber(DeliveredVolume) # LT</div>").Encoded(true);
columns.Bound(e => e.ProductVolumeAfter).Width(100).Title("Product Volume After").ClientTemplate("<div style='text-align:right;'>#= FormatNumber(ProductVolumeAfter) # LT</div>").Encoded(true);
})
.Selectable()
.Scrollable(scrolling => scrolling.Height("auto"))
.Sortable()
.Pageable(pageable => pageable
.Refresh(true)
.PageSizes(true)
.ButtonCount(10))
.Filterable(filterable => filterable
.Extra(false)
.Operators(operators => operators
.ForString(str => str.Clear()
.StartsWith("Starts with")
.Contains("Contains")
))
)
//.Groupable()
.Resizable(config =>
{
config.Columns(true);
})
.Reorderable(config =>
{
config.Columns(true);
})
.ColumnMenu()
)
</div>
Thanks
First of all this answer helped me here
I gave class name to my grid and i float:left this two div then used clear div after that problem solved.
.div1 {
float:left;
}
.clear {
clear:both;
}
.grdTank
{
width: 100%;
float:left;
}
I use yii2-poll-widget on my page.
I installed it:
php composer.phar require "pollext/poll":"dev-master"
And write on my page:
<?php
use pollext\poll\Poll;?>
<?php
echo Poll::widget([
'pollName'=>'Do you like PHP?',
'answerOptions'=>
[
'Yes',
'No',
],
]);
?>
But I get error:
Unknown Property – yii\base\UnknownPropertyException
Setting unknown property: pollext\poll\Poll::pollStatus
How can I solve my problem?
I do not recommend pollext/poll because it contains multiple errors in its core code, like missing ) or undefined index. We (I and 2 more people) tried to fix errors in its core files by hand (I know we shouldn't do that as it's a widget, sitting in vendor directory but at least we could see if it works at all).
You can try to use this code below (what we added/modified is not much, we did more to improve design and functionality but still wasn't good enough, not worth to continue):
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use pollext\poll\AjaxSubmitButton;
use yii\helpers\Url;
?>
<style>
.poll{
display: inline-block;
margin-top: 10px;
margin-bottom: 10px;
background: #ffffff;
}
.poll label{
width: 100%;
font-size: 10pt;
font-weight: bold;
display: block;
color: #464646;
}
.poll label:hover{
cursor: pointer;
}
.poll button[type="submit"]{
font-weight: bold;
font-size: 10pt;
margin-top: 10px;
color: #4682B4;
}
.poll-option-name{
font-weight: bold;
font-size: 10pt;
color: #464646;
}
.per_container{
font-weight: bold;
font-size: 10pt;
color: #464646;
padding: 0;
margin: 0;
max-width: 50px;
}
.support_forms button[type="submit"]{
border: none;
font-weight: normal;
color: #4682B4;
margin-left: 0;
padding: 0;
background: #ffffff;
}
.support_forms button[type="submit"]:hover{
text-decoration: underline;
}
.support_forms button[type="submit"]:focus{
outline: none;
border: none;
}
.support_forms{
margin-top: 0;
}
</style>
<div class="poll" style="width:<?php echo $params['maxLineWidth']+55;?>px;" >
<?php echo "<div style=\"max-width:".$params['maxLineWidth']."px; word-wrap: break-word; margin-bottom: 10px; font-size:12pt; font-weight:bold;\">".$pollData['poll_name']."</div>";?>
<?php $pullName = (isset($_POST['nameOfPoll'])) ? $_POST['nameOfPoll'] : '';?>
<?php if((Yii::$app->user->getId()==null && $_POST['pollStatus']!='show' && $isVote == false ) || ($pullName==$pollData['poll_name'] && $_POST['pollStatus']=='vote'&& $_POST['pollStatus']!='show' && Yii::$app->user->getId()==null)){
echo "Sign in to vote";
}?>
<?php if(($isVote == false && Yii::$app->user->getId()!=null && !empty($_POST['pollStatus']) && $_POST['pollStatus'] !='show') || ($pullName==$pollData['poll_name'] && $_POST['pollStatus']=='vote'&& $_POST['pollStatus']!='show' && Yii::$app->user->getId()!=null)){?>
<?php echo Html::beginForm('#', 'post', ['class'=>'uk-width-medium-1-1 uk-form uk-form-horizontal']); ?>
<?php echo Html::activeRadioList($model,'voice',$answers); ?>
<input type="hidden" name="poll_name" value="<?=$pollData['poll_name']?>"/>
<?php AjaxSubmitButton::begin([
'label' => 'Vote',
'ajaxOptions' => [
'type'=>'POST',
'url'=>'#',
'success' => new \yii\web\JsExpression('function(data){
$("body").html(data);
}'),
],
'options' => ['class' => 'customclass', 'type' => 'submit'],
]);
AjaxSubmitButton::end();
?>
<?php echo Html::endForm();
}
?>
<?php if (($isVote == false && !empty($_POST['pollStatus']) && $_POST['pollStatus'] !='show') || (Yii::$app->user->getId()==null && $_POST['pollStatus']!='show') || ($pullName==$pollData['poll_name'] && $_POST['pollStatus']=='vote'&& $_POST['pollStatus']!='show')){?>
<form method="POST" action="" class="support_forms">
<input type="hidden" name="nameOfPoll" value="<?=$pollData['poll_name']?>"/>
<input type="hidden" name="pollStatus" value="show"/>
<?php AjaxSubmitButton::begin([
'label' => 'Show results',
'ajaxOptions' => [
'type'=>'POST',
'url'=>'#',
'success' => new \yii\web\JsExpression('function(data){
$("body").html(data);
}'),
],
'options' => ['class' => 'customclass', 'type' => 'submit'],
]);
AjaxSubmitButton::end();
?>
</form>
<?php }?>
<?php if($isVote == true || ($pullName==$pollData['poll_name'] && $_POST['pollStatus']=='show') ){?>
<?php
for($i = 0; $i<count($answersData); $i++){
$voicesPer = 0;
if($sumOfVoices ==0){
$voicesPer = 0;
}else{
$voicesPer = round($answersData[$i]['value']/$sumOfVoices, 4);
}
$lineWidth = $params['maxLineWidth']*$voicesPer;
?>
<div class="single-line" style="margin-bottom: 10px; ">
<?php echo "<div class=\"poll-option-name\">".$answersData[$i]['answers'].": ".$answersData[$i]['value']."</div>"; ?>
<div style="width: <?php echo $params['maxLineWidth']; ?>px; height: <?php echo $params['linesHeight']; ?>px; background-color: <?php echo $params['backgroundLinesColor']; ?>; ">
<div style="width: <?php echo $lineWidth;?>px; height: <?php echo $params['linesHeight'] ?>px; background-color: <?php echo $params['linesColor']; ?>;">
<div class="per_container" style="display: block; line-height:<?php echo $params['linesHeight'] ?>px; height: <?php echo $params['linesHeight'] ?>px;
position: relative; left:<?php echo $params['maxLineWidth']+5; ?>px; margin: 0;"><?php echo ($voicesPer*100)."%"?></div>
</div>
</div>
</div>
<?php }?>
<?php }?>
<?php if ($isVote == false && !empty($_POST['pollStatus']) && $_POST['pollStatus'] == 'show'){?>
<form method="POST" action="" class="support_forms" style="margin-top: -10px;">
<input type="hidden" name="nameOfPoll" value="<?=$pollData['poll_name']?>"/>
<input type="hidden" name="pollStatus" value="vote"/>
<?php AjaxSubmitButton::begin([
'label' => 'Vote',
'ajaxOptions' => [
'type'=>'POST',
'url'=>'#',
'success' => new \yii\web\JsExpression('function(data){
$("body").html(data);
}'),
],
'options' => ['class' => 'customclass', 'type' => 'submit'],
]);
AjaxSubmitButton::end();
?>
<?php }?>
</form>
</div>
This modified come is taken from pollext/views/index.php file. In case you're wondering how it looks like:
Upper is a view for a person who didn't vote yet and below is a view for a person who have already voted.
I want to decrease the size of a detail view. I was able to decrease font-size through css, but can not decrease row size or padding of the generated table.
<div class="col-md-3">
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id',
'jmn',
'pri',
'rci',
'adr',
'tel',
'eml',
],
]) ?>
</div>
css
.detail-view {
font-size: 10px; -> this works
}
td {
padding: 0px; -> this doesnt do anything
margin: 0px; -> this doesnt do anything
background:green; -> this works (a test :-)
}
tr { line-height: 30px; } -> this doesnt do anything
Add style in the interessed field e.g.
<div class="col-md-3">
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id',
'jmn',
....
[
'attribute' => 'attribute_name',
....
'options' => ['style' => 'width:90px;'],
.....
],
....
]) ?>
</div>
First, try to put !important at the end of last css line:
td { padding:0px !important; height: 5px !important; }
Also it's better to be more specific in css selector. So something like this is better:
#your-table-id tr { line-height: 30px !important; }
If did not work, try to add css style inside the widget in this way:
<?= DetailView::widget([
'model' => $model,
'attributes' => [
[
'label' => 'ID',
'value' => $model->id,
'options' => ['style' => ' line-height: 30px']
],
...
],
]) ?>
i just use wysihtml5 editor in yii view page.
in this view page two editor are created.
here is the code.
this is first one ediotr
echo $form->html5EditorRow($PrintTemplateModel, 'details', array('rows' => 5, 'height' => '130px','label'=>false,'placeholder'=>'Header Layout',
'options' => array( //you could set to false any button that is not desired
'font-styles' => true,
'font'=>true,
'emphasis' => true,
'lists' => true,
'link' => true,
'image' => false,
'html' => false,
'color' => false,
'htmltable' => true,
'textjustifyCenter'=>true
)));
and this is second one
echo $form->html5EditorRow($PrintTemplateModel, 'footer', array('rows' => 5, 'height' => '130px','label'=>false,'placeholder'=>'Footer Layout',
'options' => array( //you could set to false any button that is not desired
'font-styles' => true,
'font'=>true,
'emphasis' => true,
'lists' => true,
'link' => true,
'image' => false,
'html' => false,
'color' => false,
'htmltable' => true,
'textjustifyCenter'=>true
)));
when i try to get value of both editors in jquery, it give me only value of second one editor.
jquery code
var val = editor.getValue();
console.log(val);
html code generated is like this
<ul class="wysihtml5-toolbar" style=""><li class="dropdown"><a class="btn dropdown-toggle" data-toggle="dropdown" href="#"><i class="icon-font"></i> <span class="current-font">Normal text</span> <b class="caret"></b></a><ul class="dropdown-menu"><li><a data-wysihtml5-command="formatBlock" data-wysihtml5-command-value="div" href="javascript:;" unselectable="on">Normal text</a></li><li><a data-wysihtml5-command="formatBlock" data-wysihtml5-command-value="h1" href="javascript:;" unselectable="on">Heading 1</a></li><li><a data-wysihtml5-command="formatBlock" data-wysihtml5-command-value="h2" href="javascript:;" unselectable="on">Heading 2</a></li><li><a data-wysihtml5-command="formatBlock" data-wysihtml5-command-value="h3" href="javascript:;" unselectable="on">Heading 3</a></li></ul></li><li><div class="btn-group"><a class="btn" data-wysihtml5-command="bold" title="CTRL+B" href="javascript:;" unselectable="on">Bold</a><a class="btn" data-wysihtml5-command="italic" title="CTRL+I" href="javascript:;" unselectable="on">Italic</a><a class="btn" data-wysihtml5-command="underline" title="CTRL+U" href="javascript:;" unselectable="on">Underline</a></div></li><li><div class="btn-group"><a class="btn" data-wysihtml5-command="insertUnorderedList" title="Unordered list" href="javascript:;" unselectable="on"><i class="icon-list"></i></a><a class="btn" data-wysihtml5-command="insertOrderedList" title="Ordered list" href="javascript:;" unselectable="on"><i class="icon-th-list"></i></a><a class="btn" data-wysihtml5-command="Outdent" title="Outdent" href="javascript:;" unselectable="on"><i class="icon-indent-right"></i></a><a class="btn" data-wysihtml5-command="Indent" title="Indent" href="javascript:;" unselectable="on"><i class="icon-indent-left"></i></a></div></li><li><div class="bootstrap-wysihtml5-insert-link-modal modal hide fade"><div class="modal-header"><a class="close" data-dismiss="modal">×</a><h3>Insert link</h3></div><div class="modal-body"><input value="http://" class="bootstrap-wysihtml5-insert-link-url input-xlarge"></div><div class="modal-footer">CancelInsert link</div></div><a class="btn" data-wysihtml5-command="createLink" title="Insert link" href="javascript:;" unselectable="on"><i class="icon-share"></i></a></li></ul>
<textarea rows="5" id="PrintTemplate_details" style="width: 100%; height: 130px; display: none;" name="PrintTemplate[details]" placeholder="Header Layout"></textarea>
<input type="hidden" name="_wysihtml5_mode" value="1">
<iframe class="wysihtml5-sandbox" security="restricted" allowtransparency="true" frameborder="0" width="0" height="0" marginwidth="0" marginheight="0" style="background-color: rgb(255, 255, 255); border-collapse: separate; border: 1px solid rgb(204, 204, 204); clear: none; display: inline-block; float: none; margin: 0px 0px 10px; outline: rgb(85, 85, 85) none 0px; outline-offset: 0px; padding: 4px 6px; position: static; top: auto; left: auto; right: auto; bottom: auto; z-index: auto; vertical-align: middle; text-align: start; box-sizing: content-box; -webkit-box-shadow: rgba(0, 0, 0, 0.0745098) 0px 1px 1px 0px inset; box-shadow: rgba(0, 0, 0, 0.0745098) 0px 1px 1px 0px inset; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; border-top-left-radius: 4px; width: 100%; height: 130px;"></iframe>
<span class="help-block error" id="PrintTemplate_details_em_" style="display: none"></span>
any solution for this.
i want value of both editors in jquery only.
thaks in advance.
Do it like this:
Change your first editor to:
echo $form->html5EditorRow($PrintTemplateModel, 'details',
array(
'rows' => 5,
'height' => '130px',
'label'=>false,
'placeholder'=>'Header Layout',
'id'=>'MyEditor1', //<=== Add this line (for the second editor use 'id' =>'MyEditor2'
'options' => array( .....)
));
Now you will be able to refrence them in jQuery as:
$(document).ready(function(){
var editor1 = $('#MyEditor1').val();
var editor2 = $('#MyEditor2').val();
});