Jump to content
Sign in to follow this  
anhchangtk

Use Code _IEGetObjById Error

Recommended Posts

anhchangtk

I had view 1 page, and this code

<div class="field-validator">
<span id="ctl29__vEmail" style="color: Red; display: none;">Invalid e-mail</span>
<span id="ctl29__vCEmail" style="color: Red; display: none;">Email doesn't exist</span>

Now i'm use code

$invalid = _IEGetObjById ($oIE, "ctl29__vEmail")
msgbox (0,"invalid",$invalid)

Why msgbox don't show value = "Invalid e-mail"?

Plase help me :( use _IEGetObjById to get value of ct129__vEmail or use different code >_<

Thanks, you see my topic :(

Edited by anhchangtk

Share this post


Link to post
Share on other sites
DaleHohm

msgbox (0,"invalid", IsObj($invalid))

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites
anhchangtk

msgbox (0,"invalid", IsObj($invalid))

Dale

@DaleHohm: Thanks you

I was use this code but msgbox don't show value = "Invalid e-mail" it only show 1, for email correct and incorrect >_<

Please help me

Share this post


Link to post
Share on other sites
anhchangtk

Please Help Me !!!

Share this post


Link to post
Share on other sites
PsaltyDS

@DaleHohm: Thanks you

I was use this code but msgbox don't show value = "Invalid e-mail" it only show 1, for email correct and incorrect :(

Please help me

Why would that show the inner text from the object? All you are displaying is whether it's an object or not (1=yes). To get the text use that property:
$invalid = _IEGetObjById ($oIE, "ctl29__vEmail")
If IsObj($invalid) Then
     $sTxt = _IEPropertyGet($invalid, "innertext")
     MsgBox(64, "Text", $sTxt)
Else
     MsgBox(16, "Invalid", "Not an object")
EndIf

>_<


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
anhchangtk

Why would that show the inner text from the object? All you are displaying is whether it's an object or not (1=yes). To get the text use that property:

$invalid = _IEGetObjById ($oIE, "ctl29__vEmail")
If IsObj($invalid) Then
     $sTxt = _IEPropertyGet($invalid, "innertext")
     MsgBox(64, "Text", $sTxt)
Else
     MsgBox(16, "Invalid", "Not an object")
EndIf

:D

Thanks you, but when i use this code then msgbox always show is = "Invalid e-mail" :D

Below is all code on this web

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
 
  <head>
                                                            <style>
                                                                .language-block {
                                                                    padding: 5px 3px 5px 3px; 
                                                                    background-color:#333333;
                                                                    text-align:center;
                                                                    border-top: 3px solid #222222;
                                                                    color:#FFFFFF;
                                                                }
                                                                
                                                                .language-block a {
                                                                    color: #FFFFFF;
                                                                }
                                                            </style>
                                                            
                                                            
                                                            
    <title>Liberty Reserve – largest payment processor and money transfer
system. Liberty Reserve serves millions since 2002.</title>
 
<META NAME="Keywords" CONTENT="private, digital
currency,ecurrency,e-currency,payment system, payment processor,payment
gateway,api,merchant,merchant payment solution,online
banking,money,transfer,finance service,payment service,safely store
funds,buy,sell,exchange,forex,casino,sports betting,poker,on-line">
 
<META name="description" content="Oldest, safest and most popular
payment processor operating in Costa Rica and serving millions all
around a world. Store your funds privately in gold, Euro or USD. Use Liberty
Reserve in on-line casinos, poker rooms, sports betting, forex or in any
other on-line store.">
 
    <link rel="stylesheet" href="/en/css/services.css" type="text/css">
    <link rel="icon" href="/en/favicon.ico" type="image/ico">
    <link rel="shortcut icon" href="/en/favicon.ico" type="image/ico">      
    <script type="text/javascript" language="javascript" src="/en/js/scrapheap/common.js"></script> 
  </head>
 
  <body marginleft="0" merginright="0" margintop="0" marginbottom="0" class="services">
    <table style="width: 100%; height: 100%" cellpadding="0" cellspacing="0" border="0" >
            <tr>
                <td class="logo-block">
                &nbsp;</td>
            </tr>
            
            
      <tr>
        <td style="vertical-align: top" class="services-body-block">
            <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; height: 100%" >
                <tr>
                    <td class="left-menu-block" style="width: 225px; vertical-align: top">
                              <table cellpadding="0" cellspacing="0" border="0" style="width: 100%" >
            <tr >
              <td class="left-menu-block left-menu-block-bg" style="vertical-align: top">
                            
                        &nbsp;</td>
          </table>
 
 
                    </td>
                    <td style="vertical-align: top">
 
<div class="text">
    &nbsp;</div>
    <form name="ctl11" method="post" action="index.aspx" onsubmit="javascript:return WebForm_onsubmit();" id="ctl11">
<div>
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLTIyNzEwNjkyNg9kFhYCAg9kFgICAQ8UKwADZAUkUGFnZXMuU2VydmljZXMuQWNjb3VudFJlbWluZGVyLlRpdGxlZGQCBQ8WAh4EaHJlZgUUL2VuL2Nzcy9zZXJ2aWNlcy5jc3NkAgcPFgIfAAUPL2VuL2Zhdmljb24uaWNvZAIJDxYCHwAFDy9lbi9mYXZpY29uLmljb2QCCw8WAh4Dc3JjBRovZW4vanMvc2NyYXBoZWFwL2NvbW1vbi5qc2QCFA9kFgoCAQ9kFgICAQ8UKwADZAUgTWVudS5TZXJ2aWNlcy5MZWZ0LkFjY291bnQuVGl0bGVkZAIDD2QWAgIBDxQrAANkBR9NZW51LlNlcnZpY2VzLkxlZnQuUmVtaW5kLlRpdGxlZGQCBQ9kFgICAQ8UKwADZAUaTWVudS5Ub3AuU3RvcEFjY291bnQuVGl0bGVkZAIHD2QWA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HVyaW5nZAIfDxQrAAQPFgQeDU9uQ2xpZW50Q2xpY2sF1QFqYXZhc2NyaXB0OmlmICh0eXBlb2YoUGFnZV9DbGllbnRWYWxpZGF0ZSkgPT0gJ2Z1bmN0aW9uJykgeyB2YXIgUGFnZUNsaWVudFZhbGlkID0gUGFnZV9DbGllbnRWYWxpZGF0ZSgpOyBpZiAoIVBhZ2VDbGllbnRWYWxpZCkgcmV0dXJuIGZhbHNlOyB9IHRoaXMuZGlzYWJsZWQgPSB0cnVlOyBfX2RvUG9zdEJhY2soJ2N0bDI5JGJ0blN1Ym1pdCcsJycpOyByZXR1cm4gdHJ1ZTsfAgUEU2VuZGRoZWdkAiEPFCsAAhQrAANkBQxCdXR0b25zLlNlbmRkBQlidG5TdWJtaXRkAh8PFCsAA2QFG1BhZ2VzLkNvbW1vbi5Db3B5cmlnaHRZZWFyc2RkAiEPFCsAA2QFFlBhZ2VzLkNvbW1vbi5Db3B5cmlnaHRkZGREaGi3yEZyUGTSxI9SmyBf0k2wTQ==" />
</div>
 
<script type="text/javascript"> 
//<![CDATA[
var theForm = document.forms['ctl11'];
if (!theForm) {
    theForm = document.ctl11;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]>
</script>
 
 
<script src="/en/WebResource.axd?d=MQcArJa7yF13-0LokUyZUg2&amp;t=633724807628750000" type="text/javascript"></script>
 
 
<script src="/en/WebResource.axd?d=EJRzN9rQlmz_jIuNW8Zi56KUybRoVutxqGictmXCGfI1&amp;t=633724807628750000" type="text/javascript"></script>
<script type="text/javascript"> 
//<![CDATA[
function WebForm_onsubmit() {
if (typeof(Validatoronsubmit) == "function" && Validatoronsubmit() == false) return false;
return true;
}
//]]>
</script>
 
<div>
 
    <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWBAKP0OfABAKG2YSJDgLv7sKiBQLBja+HA+RpVdeHbwGtiSVw/PNTz4B8svXi" />
</div>
        <div id="ctl29__formPanel">
    
<table cellpadding="0" cellspacing="0" border="0" class="form" style="width: 100%" >
    <tr>
        <td style="width: 25%" class="field-title">
            <span class="asterisk">*</span>Your E-mail
        </td>
        <td class="field-value">
            <input name="ctl29$_email" type="text" id="ctl29__email" style="width:100%;" />
            <div class="field-validator">
                <span id="ctl29__vEmail" style="color:Red;display:none;">Invalid e-mail</span>
                
                <span id="ctl29__vCEmail" style="color:Red;display:none;">Email doesn't exist</span>
                
            </div>
        </td>
        <td class="field-required-validator" style="width: 15%">
            <span id="ctl29__vREmail" style="color:Red;display:none;">↑&nbsp;You must fill this field</span>
            
        </td>
        <td class="field-hint" style="width: 25%">&nbsp;
        </td>       
    </tr>
    <tr>
        <td colspan="2">
            <b>Enter the code (turing number) shown on the image</b><br/> (Note: If you cannot read the numbers, reload the page to generate a new one):
 
        </td>
    </tr>
    <tr>
        <td class="field-title code">
            <img id="ctl29_imgTuringCode" border="0" vspace="0" hspace="0" src="index.aspx?imgcode" style="border-width:0px;" />
        </td>
        <td class="field-value code">
            <input name="ctl29$txtTuringCode" type="text" maxlength="6" id="ctl29_txtTuringCode" style="width:100px;" />
            <div class="field-validator">
                <span id="ctl29_valTuringCode" style="color:Red;display:none;">Invalid turing code entered. Please click "Refresh" button on your browser to update image and try again.</span>
                 
            </div>
            
        </td>
        <td class="field-required-validator">
            <span id="ctl29__valTuring" style="color:Red;display:none;">↑&nbsp;You must fill this field</span>
            
        </td>
    </tr>
    <tr>
        <td class="buttons" colspan="2">
            <input type="submit" name="ctl29$btnSubmit" value="Send" onclick="javascript:if (typeof(Page_ClientValidate) == 'function') { var PageClientValid = Page_ClientValidate(); if (!PageClientValid) return false; } this.disabled = true; __doPostBack('ctl29$btnSubmit',''); return true;WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl29$btnSubmit&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" id="ctl29_btnSubmit" />
            
        </td>
    </tr>
</table>
 
</div>
 
 
 
 
    
<script type="text/javascript"> 
//<![CDATA[
var Page_Validators =  new Array(document.getElementById("ctl29__vEmail"), document.getElementById("ctl29__vCEmail"), document.getElementById("ctl29__vREmail"), document.getElementById("ctl29_valTuringCode"), document.getElementById("ctl29__valTuring"));
//]]>
</script>
 
<script type="text/javascript"> 
//<![CDATA[
var ctl29__vEmail = document.all ? document.all["ctl29__vEmail"] : document.getElementById("ctl29__vEmail");
ctl29__vEmail.controltovalidate = "ctl29__email";
ctl29__vEmail.errormessage = "Invalid e-mail";
ctl29__vEmail.display = "Dynamic";
var ctl29__vCEmail = document.all ? document.all["ctl29__vCEmail"] : document.getElementById("ctl29__vCEmail");
ctl29__vCEmail.controltovalidate = "ctl29__email";
ctl29__vCEmail.errormessage = "Email doesn\'t exist";
ctl29__vCEmail.display = "Dynamic";
ctl29__vCEmail.evaluationfunction = "CustomValidatorEvaluateIsValid";
var ctl29__vREmail = document.all ? document.all["ctl29__vREmail"] : document.getElementById("ctl29__vREmail");
ctl29__vREmail.controltovalidate = "ctl29__email";
ctl29__vREmail.errormessage = "←";
ctl29__vREmail.display = "Dynamic";
ctl29__vREmail.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
ctl29__vREmail.initialvalue = "";
var ctl29_valTuringCode = document.all ? document.all["ctl29_valTuringCode"] : document.getElementById("ctl29_valTuringCode");
ctl29_valTuringCode.controltovalidate = "ctl29_txtTuringCode";
ctl29_valTuringCode.errormessage = "Invalid code";
ctl29_valTuringCode.display = "Dynamic";
ctl29_valTuringCode.evaluationfunction = "CustomValidatorEvaluateIsValid";
var ctl29__valTuring = document.all ? document.all["ctl29__valTuring"] : document.getElementById("ctl29__valTuring");
ctl29__valTuring.controltovalidate = "ctl29_txtTuringCode";
ctl29__valTuring.errormessage = "←";
ctl29__valTuring.display = "Dynamic";
ctl29__valTuring.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
ctl29__valTuring.initialvalue = "";
//]]>
</script>
 
 
<script type="text/javascript"> 
//<![CDATA[
 
var Page_ValidationActive = false;
if (typeof(Validatoronload) == "function") {
    Validatoronload();
}
 
function Validatoronsubmit() {
    if (Page_ValidationActive) {
        return ValidatorCommononsubmit();
    }
    else {
        return true;
    }
}
        //]]>
</script>
</form>
    
                            </td>
                        </tr>
                        <tr>
                            <td valign="bottom">
                                
                            </td>
                            
                    </tr>
                </table>
            </td>
            </tr>
            <tr>
                            <td class="copyright-block" style="padding-left: 270px; padding-right: 0px">
                                <div>
                                            &nbsp;</div>            
                                
                            </td>
      </tr>
    </table>
    
                                                 
<script type="text/javascript"> 
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript"> 
var pageTracker = _gat._getTracker("UA-2468425-1");
pageTracker._trackPageview();
</script>
  </body>
</html>

I had quote this code

<td class="field-value">
            <input name="ctl29$_email" type="text" id="ctl29__email" style="width:100%;" />
            <div class="field-validator">
                <span id="ctl29__vEmail" style="color:Red;display:none;">Invalid e-mail</span>
                
                <span id="ctl29__vCEmail" style="color:Red;display:none;">Email doesn't exist</span>
                
            </div>
        </td>

Please help me, i'm verry need :D

Thank, you had view my post :D

Edited by anhchangtk

Share this post


Link to post
Share on other sites
anhchangtk

please help me

I'm very need :D

Share this post


Link to post
Share on other sites
PsaltyDS

Thanks you, but when i use this code then msgbox always show is = "Invalid e-mail" :D

Below is all code on this web

I had quote this code

<td class="field-value">
            <input name="ctl29$_email" type="text" id="ctl29__email" style="width:100%;" />
            <div class="field-validator">
                <span id="ctl29__vEmail" style="color:Red;display:none;">Invalid e-mail</span>
                
                <span id="ctl29__vCEmail" style="color:Red;display:none;">Email doesn't exist</span>
                
            </div>
        </td>

Please help me, i'm verry need :D

Thank, you had view my post :D

I don't get it... :D

What did you want it to get? If that object's text is "Invalid e-mail" then that's what you should get when you read the innertext property. If the object's text changes, then you should get the new text.

What did I miss?

:D


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
anhchangtk

I don't get it... :D

What did you want it to get? If that object's text is "Invalid e-mail" then that's what you should get when you read the innertext property. If the object's text changes, then you should get the new text.

What did I miss?

:D

I want get error show on the web :D "Invalid e-mail" if use by from object name or id then only get 1 text :D but on web it will change if email incorrect

Share this post


Link to post
Share on other sites
PsaltyDS

I want get error show on the web :D "Invalid e-mail" if use by from object name or id then only get 1 text :D but on web it will change if email incorrect

Either your English or mine isn't up to the task here... :D

What's your native language? There are a lot of smarter people than me on this forum that can handle other languages fluently.

:D


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×