because it's sometimes hard to find the syntax for some jquery things..
i couldn't make my radio buttons checked while using the
$.("#opt_pkg_other_promo1")....
and i didn't want to ask for such a simple thing.. which works well with
simple javascript..
But if u know the answer, i'll take it..
And if u want to know everything.. i've got another strange problem..
(i've found a solution, but weird..)
when i first click on the radio button, i've got the blockui box, with
content ok.. but if i enter wrong code, close the blockui box, and retry
another code, the content of the box changed.. to undefined ! i can't
understand why..
so i've made a "var codepromo_save" that u can see in the code ..
> var codepromo = $('#codepromo')[0];
>
> if(codepromo==undefined)
> {
> codepromo = codepromo_save;
> }
> else
> {
> codepromo_save = codepromo;
> }
this part of script is just a workaround to keep the content of the
blockui box..
thanks anyway for the help
Alexandre Plennevaux a écrit :
> Glad you made it work! Why don't u use consistent jquery syntax throughout
> your script?
>
> document.getElementById
>
> ??
>
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of vince
> Sent: jeudi 1 février 2007 14:55
> To: [email protected]
> Subject: Re: [jQuery] Ajax get And Thickbox, problem accessing value
>
>
> thanks, no problem with blockUI..
>
> here is the working script :
> <script type="text/javascript">
>
> var codepromo_save;
>
> $(document).ready(function(){
>
> document.getElementById("opt_pkg_other_promo1").checked = true;
> $("[EMAIL PROTECTED]'opt_pkg_other_promo2']").after("<span
> id='resultat'></span>");
> $("[EMAIL PROTECTED]'opt_pkg_other_promo2']").click(
> function(){
> if(this.value == "avec_promo")
> {
> document.getElementById("opt_pkg_other_promo1").checked
> = true;
>
> var codepromo = $('#codepromo')[0];
>
> if(codepromo==undefined)
> {
> codepromo = codepromo_save;
> }
> else
> {
> codepromo_save = codepromo;
> }
>
> $.blockUI(codepromo, {border: '3px solid #ccc', width:
> '300px',
> backgroundcolor: '#ccc' });
>
> $("div.verif").html("");
>
> $("input#yes").click(
> function()
> {
> var params = 't='+new Date().getTime()
> +'&code='+document.getElementById("textecode").value;
> $.blockUI("<h1>Verification de votre code en
> cours...</h1>", { border:
> '3px solid #ccc' } );
>
> $.ajax({
> url: '../verif.php?' + params, // prevent caching in IE
> complete: function(data) {
> // unblock when remote call returns
> $.unblockUI();
>
> if(data.responseText == "1")
> {
>
> $("input#verif").hide("fast");
>
> $("#resultat").html(" <strong>Merci, votre code est valide !</strong>");
>
> document.getElementById("opt_pkg_other_promo2").checked = true;
>
> $("[EMAIL PROTECTED]'opt_pkg_other_promo']").unbind();
> }
> else
> {
>
> $("#resultat").html(" <strong>Code invalide</strong>");
>
> document.getElementById("opt_pkg_other_promo1").checked = true;
> }
> }
> });
>
> return false;
> });
>
> $('#no').click($.unblockUI);
> }
> });
> });
> </script>
>
>
>
> vince wrote:
>> no, i didn't try, but maybe, it'll be a better way to do it i'll take
>> a look right now, thanks for the tip !
>>
>>
>>
>> Alexandre Plennevaux-2 wrote:
>>> Did you try blockUI ?
>>>
>>> -----Original Message-----
>>> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
>>> On Behalf Of vince
>>> Sent: jeudi 1 février 2007 11:19
>>> To: [email protected]
>>> Subject: Re: [jQuery] Ajax get And Thickbox, problem accessing value
>>>
>>>
>>> nobody puts inputs in a thickbox and needs to access his value ??
>>>
>>> my script works well when i comment the line :
>>>
>>> TB_show('Verification du code promo',
>>> '#TB_inline?height=120&width=220&inlineId=codepromo', null); but
>>> whithout thickbox, it's not pretty.. ?
>>>
>>>
>>>
>>>
>>> vince wrote:
>>>> Hi,
>>>>
>>>> I'm trying to make an ajax validation for reductions codes..
>>>>
>>>> I've got an hidden form to test the value :
>>>>
>>>> My problem is that when i use thickbox, i don't have access to the
>>>> value of my input text anymore !!
>>>>
>>>> my input #code doesn't seems to have a value !!
>>>>
>>>> What's the problem ?? how can i get this value ??
>>>>
>>>> Thanks in advance
>>>>
>>>>
>>>>
>>>> <div id='codepromo' style='display:none;'>
>>>> <input type='text' name='code' id='code'/>
>>>> <input type='button' name='verif' id='verif' value='Vérifier
>>>> le code !'/>
>>>> <br/>
>>>> <div class='verif'></div>
>>>> </div>
>>>>
>>>>
>>>> and here is my jquery code :
>>>>
>>>> <link rel="stylesheet" href="../thickbox.css" type="text/css"
>>>> media="screen" />
>>>> <script type="text/javascript"
>>>> src="/v3/scripts_js/jquery.js"></script>
>>>> <script type="text/javascript" src="../thickbox.js"></script>
>>>>
>>>> <script type="text/javascript">
>>>> $(document).ready(function(){
>>>>
>>>> document.getElementById("opt_pkg_other_promo1").checked = true;
>>>>
>>>> $("[EMAIL PROTECTED]'opt_pkg_other_promo2']").click(
>>>> function(){
>>>> if(this.value == "avec_promo")
>>>> {
>>>>
>>> document.getElementById("opt_pkg_other_promo1").checked = true;
>>>>
>>>> TB_show('Verification du code promo',
>>>> '#TB_inline?height=120&width=220&inlineId=codepromo', null);
>>>>
>>>> $("div.verif").html("");
>>>> $("input#verif").show("fast");
>>>> $("div#codepromo").show("slow");
>>>>
>>>> $("input#verif").click(
>>>> function()
>>>> {
>>>> alert($("input.code").val());
>>>> $("div.verif").html(" ../ajax-loader.gif ");
>>>> $.get("../verif.php",
>>>> {code:$("input#code").val()},
>>>> function(data){
>>>> if(data == "1")
>>>> {
>>>> $("input#verif").hide("fast");
>>>> $("div.verif").html("<strong>Merci,
>>> votre code est valide
>>>> !</strong>");
>>>>
>>> document.getElementById("opt_pkg_other_promo2").checked = true;
>>> $("[EMAIL PROTECTED]'opt_pkg_other_promo']").unbind();
>>>> }
>>>> else
>>>> {
>>>> $("div.verif").html("<strong>Code
>>> Invalide !</strong>");
>>> document.getElementById("opt_pkg_other_promo1").checked = true;
>>>> }
>>>> });
>>>> });
>>>> }
>>>> });
>>>> });
>>>> </script>
>>>>
>>>>
>>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Ajax-get-And-Thickbox%2C-problem-accessing-valu
>>> e-tf314
>>> 9610.html#a8745855
>>> Sent from the JQuery mailing list archive at Nabble.com.
>>>
>>>
>>> _______________________________________________
>>> jQuery mailing list
>>> [email protected]
>>> http://jquery.com/discuss/
>>>
>>> --
>>> Ce message Envoi est certifié sans virus connu.
>>> Analyse effectuée par AVG.
>>> Version: 7.5.441 / Base de données virus: 268.17.18/662 - Date:
>>> 31/01/2007
>>> 15:16
>>>
>>>
>>>
>>> _______________________________________________
>>> jQuery mailing list
>>> [email protected]
>>> http://jquery.com/discuss/
>>>
>>>
>>
>
> --
> View this message in context:
> http://www.nabble.com/Ajax-get-And-Thickbox%2C-problem-accessing-value-tf3149610.html#a8748601
> Sent from the JQuery mailing list archive at Nabble.com.
>
>
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
>
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/