![]() |
|
|
|||||||
| Javascript and Ajax Questions and information about working with Ajax and Javascript in Delphi for PHP. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
iWGSM contacts tab
The submit email button has the following code: function Button1JSClick($sender, $params) { echo $this->Button1->ajaxCall("savecontact"); ?> //Add your javascript code here alert('Your Email has been sent.'); return false; <?php } function savecontact() { if ($this->ComboBox2->ItemIndex == '1' ) { $mr = 'Mr';} if ($this->ComboBox2->ItemIndex == '2' ) { $mr = 'Mrs';} if ($this->ComboBox2->ItemIndex == '3' ) { $mr = 'Miss';} if ($this->ComboBox2->ItemIndex == '4' ) { $mr = 'Dr';} if ($this->ComboBox2->ItemIndex == '5' ) { $mr = 'Other';} $firstname = $this->JTAdvancedEdit2->Text; $surname = $this->JTAdvancedEdit3->Text; $email = $this->JTAdvancedEdit4->Text; $tel = $this->JTAdvancedEdit5->Text; $comments = $this->Memo1->Text; $sql = "insert into contacts_from_web(`title`,`firstname`,`surname`,`e mail`,`contactno`,`notes`)". // indicate all fields here "values ('".$mr."','".$firstname."','".$surname."','".$ema il."','".$tel."','".$comments."')"; $this->dbiwitness->execute($sql); $this->JTAdvancedEdit2->Text = ''; $this->JTAdvancedEdit3->Text = ''; $this->JTAdvancedEdit4->Text = ''; $this->JTAdvancedEdit5->Text = ''; $this->Memo1->Text = ''; } The record is inserted each time but in IE I get an error message but not in firefox. Also how do I capture the error in IE as you can in FF. Cheers SteveW |
| Sponsored Links |
|
|
|
|||
|
I seem to have the same issue here and I'm at a total loss on how to fix it.
what I basically do is do an ajax call, and I process data on the form. based on the result, i make some changes to the color and contents of a panel. Can't get anymore basic than that imho. In Firefox I don't have a problem and everything works as planned, but in IE for some odd reason, i'm getting a rather nasty XML error thrown at me. The XML error kind of shows me that what is returned is the entire site as XML content. Weird though that Firefox has no problems with this. Can anyone point out to me how I can fix this ? ![]() |
|
|||
|
Huh ? I must have overlooked that approximately a thousand times then.
Anyways, I'll check this out and see how it goes... edit : Yep, that did the trick. Thanks a bunch So what basically happens here is that I provide an array with names of controls to xajax and that xajax will limit it's response to those controls ? Or at least that is what it looks like in debug mode. I'm a bit ashamed that I didn't see this any sooner. Oh well, again, thanks, that was a lifesaver. Last edited by UptownWings; 12th June 2009 at 05:28. Reason: Tried solution |
|
|||
|
function Button3JSClick($sender, $params)
{ ?> xajax_ajaxProcess('Asiento','Button1',params,'Limp iarForm',xajax.getFormValues('Asiento'),[]); return false; <?php } Asiento="Nombre de la Forma", en este caso se llama 'Asiento'. LimpiarForm= funcion definida por el usuario. []= Colocar los objetos que se enviarán con el ajax, ejemplo['Edit1','Edit2'] |