jQWidgets Forums
jQuery UI Widgets › Forums › Editors › Input, Password Input, TextArea, ColorPicker, Rating, TagCloud, Loader › jqxTextArea and data
Tagged: Angular textarea, bootstrap Textarea, javascript Textarea, jQuery textarea, jqwidgets Textarea, jqxTextArea
This topic contains 3 replies, has 2 voices, and was last updated by Christopher 8 years, 10 months ago.
-
AuthorjqxTextArea and data Posts
-
Hello as I capture the data entered ?
//mysql
if (isset($_GET[‘update’])) {
$id = $_GET[‘id’];
$descripcion=$_GET[‘descripcion’];
$realizado=$_GET[‘realizado’];
$idpoliza=$_GET[‘poliza’];
$sql = “UPDATE expediente SET descripcion=’$descripcion’, realizado=’$realizado’,idpoliza=$idpoliza where id=’$id'”;
$stmt = $con->prepare($sql);
$stmt->execute();
$con->closed;
$sql->closed;}
//html
<div style=”width: auto; display:table-cell”>
<textarea id=”poliza”></textarea>
<br /><div style=”font-family: Verdana; font-size: 13px;” id=’selectionlog’></div>
</div>
//js
…
if (editrow >= 0) {
var row = {
descripcion: $(“#descripcion”).val(descripcion),
realizado: $(“#realizado”).val(realizado),
poliza: $(“#poliza”).val(poliza) // this does not work for me
poliza: ‘1234556’ // this if it works
};
…
$(‘#poliza’).jqxTextArea({
source: datapolizas,
displayMember: “polizas_poliza”,
valueMember: “polizas_id”,
width: 100, height: 20 });
$(‘#poliza’).on(‘select’, function (event) {
if (event.args) {
var item = event.args.item;
if (item) {
var valueelement = $(“<div></div>”);
valueelement.text(“id: ” + item.value);
var labelelement = $(“<div></div>”);
labelelement.text(“Poliza: ” + item.label);
$(“#selectionlog”).children().remove();
$(“#selectionlog”).append(labelelement);
$(“#selectionlog”).append(valueelement);
}
}
});
…Hi famp,
the problem is that you are not using the val() method correctly. You are trying to set the value of the property instead of getting it. Replace the “$(“#poliza”).val(poliza)” with “$(“#poliza”).val()”. The same goes to any other attributes that you wish to assign a value to from the text area. Also you can set a “name” attribute on the text area element and place it in a form so you can assign your parameters on submit directly.Best Regards,
ChristopherjQWidgets Team
http://www.jqwidgets.comThanks , solved .
I have another question , as I write in placeholder the value of empleado_nombre ejemple.having these types of data:
var dataRecord = $(“#jqxgrid”).jqxGrid(‘getrowdata’, editrow);
$(“#expediente”).val(dataRecord.expediente);
$(“#poliza”).val(dataRecord.poliza);
$(“#polizasid”).val(dataRecord.polizasid);
$(“#clienteid”).val(dataRecord.clienteid);
$(“#codigo”).val(dataRecord.codigorepara);
$(“#factura”).val(dataRecord.facturar);
$(“#descripcion”).val(dataRecord.descripcion);
$(“#realizado”).val(dataRecord.realizado);
$(“#fecha”).val(dataRecord.fecha);
$(“#hora”).val(dataRecord.hora);
$(“#fechafin”).val(dataRecord.fechafin);
$(“#fechadevolucion”).val(dataRecord.fechadevolucion);
$(“#horafin”).val(dataRecord.horafin);
$(“#nombre_cliente”).val(dataRecord.nombre_cliente);
$(“#domicilio”).val(dataRecord.domicilio);
$(“#telefono_cliente”).val(dataRecord.telefono_cliente);
$(“#empleado_nombre”).val(dataRecord.empleado_nombre);Hi famp,
your code looks correct. If you are not getting the expected result, check if “editrow” is a correct gridrowdata ID. Also the type of the dataRecord.empleado_nombre must be string in order to be set to a textArea field.
Best Regards,
ChristopherjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.