Click here to Skip to main content
14,449,574 members

JavaScript

 
AnswerRe: Redirecting to the URL after Submit Pin
Nathan Minier7-Mar-19 2:39
professionalNathan Minier7-Mar-19 2:39 
GeneralRe: Redirecting to the URL after Submit Pin
simpledeveloper7-Mar-19 9:29
Membersimpledeveloper7-Mar-19 9:29 
GeneralRe: Redirecting to the URL after Submit Pin
simpledeveloper7-Mar-19 11:52
Membersimpledeveloper7-Mar-19 11:52 
GeneralRe: Redirecting to the URL after Submit Pin
Nathan Minier11-Mar-19 2:15
professionalNathan Minier11-Mar-19 2:15 
GeneralRe: Redirecting to the URL after Submit Pin
simpledeveloper12-Mar-19 7:32
Membersimpledeveloper12-Mar-19 7:32 
GeneralRe: Redirecting to the URL after Submit Pin
simpledeveloper13-Mar-19 7:24
Membersimpledeveloper13-Mar-19 7:24 
QuestionToggling two Radio buttons depending upon enum values in Angular 2.0 Pin
simpledeveloper27-Feb-19 14:38
Membersimpledeveloper27-Feb-19 14:38 
QuestionAJAX,how to get more values from $.ajax({}) function in a Zend Controller Pin
serenimus25-Feb-19 9:49
Memberserenimus25-Feb-19 9:49 
Hallo to the comunity,

That ist the problem, Im trying to send two values/variables fron my view (opciones.phtml), to my controller/action through an Ajax function. I get it with only one parameter, but with two I dont get it!!Mad | :mad:

I`ll thank any help

this is my html:


<span class="badge btn-primary" onclick="saveNombre();">guardar</span>
<span class="badge btn-success" id="resultado"></span>


this is my javascript function, inside I invoke the ajax function..


<script type="text/javascript">


function saveNombre(){

var nombre=document.getElementById("nombre").value;
var codc=<?=$this->codcli?>;


if(nombre!==""){


$.ajax({
type:"POST",
data:dataString,
dataType:{nombre:nombre,codc:codc},
cache:false,
url:"<?=$this->basePath("alta/areapersonal/updatenombreclienteajax")?>",
success:function(datos){
$("#resultado").html(datos);

}
});


}else{
return null;
}


}






here you find the data recepcion from view/ajax,in the controller/Action
if you send only one parameter, from ajax function, you can easily "clean" the value
with the PHP function trim();

but in this case, I,m try to send two values, customer code and Name, I need to include this
to parameters in a function to update the name of the customer, but I dont´t konw hoe to extract from
$datosCliente,

some Idea?, thanks !!


public function updateNombreClienteAjaxAction(){

if($this->request->isxmlHttpRequest()){

$datosCliente= $this->request->getContent("data");



}else{
var_dump("Error action Ajax");
}

}
QuestionHow to identify if string is a phone number, Email address or a web address in Javascript? Pin
Member 1397526717-Feb-19 15:51
MemberMember 1397526717-Feb-19 15:51 
SuggestionRe: How to identify if string is a phone number, Email address or a web address in Javascript? Pin
Richard MacCutchan17-Feb-19 23:05
communityengineerRichard MacCutchan17-Feb-19 23:05 
AnswerRe: How to identify if string is a phone number, Email address or a web address in Javascript? Pin
Blikkies27-Feb-19 3:28
professionalBlikkies27-Feb-19 3:28 
QuestionAssignment help? Pin
Member 141452369-Feb-19 13:49
MemberMember 141452369-Feb-19 13:49 
AnswerRe: Assignment help? Pin
Richard MacCutchan9-Feb-19 23:51
communityengineerRichard MacCutchan9-Feb-19 23:51 
AnswerRe: Assignment help? Pin
ZurdoDev27-Feb-19 4:50
mveZurdoDev27-Feb-19 4:50 
QuestionJavaScript Environment Pin
Member 141438347-Feb-19 22:44
MemberMember 141438347-Feb-19 22:44 
AnswerRe: JavaScript Environment Pin
Richard MacCutchan7-Feb-19 23:31
communityengineerRichard MacCutchan7-Feb-19 23:31 
AnswerMessage Closed Pin
24-Feb-19 23:41
MemberMember 1416175924-Feb-19 23:41 
QuestionJavaScript in Microsoft Visual Studio Pin
Member 141438347-Feb-19 22:43
MemberMember 141438347-Feb-19 22:43 
AnswerRe: JavaScript in Microsoft Visual Studio Pin
Richard MacCutchan7-Feb-19 23:29
communityengineerRichard MacCutchan7-Feb-19 23:29 
AnswerMessage Closed Pin
10-Feb-19 20:03
MemberEriccodejob10-Feb-19 20:03 
QuestionSimple Modal Dialog Pin
Bram van Kampen31-Jan-19 12:58
MemberBram van Kampen31-Jan-19 12:58 
AnswerRe: Simple Modal Dialog Pin
Richard Deeming8-Feb-19 2:09
communityengineerRichard Deeming8-Feb-19 2:09 
QuestionCalling Web api from Angular Service and Component Pin
simpledeveloper29-Jan-19 8:07
Membersimpledeveloper29-Jan-19 8:07 
AnswerMessage Closed Pin
31-Jan-19 20:43
professionalElla Brown31-Jan-19 20:43 
QuestionFor loop query Pin
Member 1413327128-Jan-19 23:54
MemberMember 1413327128-Jan-19 23:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.