rm4453

_IEFormElementSetValue Help!

3 posts in this topic

I am trying to get my code to be loopable based off of a variable count for example number of images selected variable is named $imgCount = 6 (meaning there were 6 images selected) I need to know if this will work assuming all images paths are stored in the gui created...

$image1

$image2

$image3

$image4

$image5

$image6

That would be the variable names that would equal the gui for guictrlread ....

$ImUploadCount = 0
$imageCounter = 6 ; has been set by incrementing every time an image was picked via gui button 1-6 we will assume it equals 6

Func Upload()

Do
$imUpload = $ImUploadCount + 1

_IEFormElementSetValue($browsefield, GUICtrlRead($Image & $imUpload))

Until $imageCounter = $imUpload

So Essentially will $Image & $imUpload provide $image1, $image2, $image3, etc... when it sets the value then uploads? or will that cause a problem...? "is there a better way to do this?

Share this post


Link to post
Share on other sites
$ImUploadCount = 0
$imageCounter = 6 ; has been set by incrementing every time an image was picked via gui button 1-6 we will assume it equals 6

Func Upload()

Do
_IEFormElementSetValue($browsefield, GUICtrlRead($Image & $imUpload))
$ImUploadCount += 1
Until $imageCounter = $ImUploadCount

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

10 hours ago, Dgameman1 said:
$ImUploadCount = 0
$imageCounter = 6 ; has been set by incrementing every time an image was picked via gui button 1-6 we will assume it equals 6

Func Upload()

Do
_IEFormElementSetValue($browsefield, GUICtrlRead($Image & $imUpload))
$ImUploadCount += 1
Until $imageCounter = $ImUploadCount

 

Sweet Thanks... btw one more ? Would this work to grab the file path from a gui store it as a variable then put then upload the file on a webpage? I keep getting the error Browser security prevents SetValue of TYPE=FILE when I use _IEFormElemntSetValue so I am wondering if this would work to set the file....

 

$imUploadCount = 0
$ImageCounter = 6 ; This is set via buttons in gui based of of how many images are selected
            Do
                $imUpload = $imUploadCount + 1

                $oForm = _IEFormGetObjByName($ksl, "f-142")
                $oInputFile = _IEFormElementGetObjByName($oForm, "142")

                ; Assign input focus to the field and then send the text string
                _IEAction($oInputFile, "focus")
                _IEAction($oInputFile, "click")
                If $imUpload = 1 Then
                    Send(GUICtrlRead($Image1))
                ElseIf $imUpload = 2 Then
                    Send(GUICtrlRead($Image2))
                ElseIf $imUpload = 3 Then
                    Send(GUICtrlRead($Image3))
                ElseIf $imUpload = 4 Then
                    Send(GUICtrlRead($Image4))
                ElseIf $imUpload = 5 Then
                    Send(GUICtrlRead($Image5))
                ElseIf $imUpload = 6 Then
                    Send(GUICtrlRead($Image6))
                EndIf


                ;Find Image Description field!
                $descriptionimfield = _IEGetObjById($ksl, "d-142")
                If Not @error Then
                    ; MsgBox("Success", "Email Input Found", "Next Step!")
                Else
                    ;MsgBox("Failed", "Email Input Not Found", "Try Again!")
                    Exit
                EndIf


                ;Fill Image Description(s) field!
                If $imUpload = 1 Then
                    _IEFormElementSetValue($descriptionimfield, $Image1_Description)
                    If Not @error Then
                        ; MsgBox("Success", "Email Input Filled", "Next Step!")
                    Else
                        ;MsgBox("Failed", "Email Input Not Filled", "Try Again!")
                        Exit
                    EndIf
                ElseIf $imUpload = 2 Then
                    _IEFormElementSetValue($descriptionimfield, $Image2_Description)
                    If Not @error Then
                        ; MsgBox("Success", "Email Input Filled", "Next Step!")
                    Else
                        ;MsgBox("Failed", "Email Input Not Filled", "Try Again!")
                        Exit
                    EndIf
                ElseIf $imUpload = 3 Then
                    _IEFormElementSetValue($descriptionimfield, $Image3_Description)
                    If Not @error Then
                        ; MsgBox("Success", "Email Input Filled", "Next Step!")
                    Else
                        ;MsgBox("Failed", "Email Input Not Filled", "Try Again!")
                        Exit
                    EndIf
                ElseIf $imUpload = 4 Then
                    _IEFormElementSetValue($descriptionimfield, $Image4_Description)
                    If Not @error Then
                        ; MsgBox("Success", "Email Input Filled", "Next Step!")
                    Else
                        ;MsgBox("Failed", "Email Input Not Filled", "Try Again!")
                        Exit
                    EndIf
                ElseIf $imUpload = 5 Then
                    _IEFormElementSetValue($descriptionimfield, $Image5_Description)
                    If Not @error Then
                        ; MsgBox("Success", "Email Input Filled", "Next Step!")
                    Else
                        ;MsgBox("Failed", "Email Input Not Filled", "Try Again!")
                        Exit
                    EndIf
                ElseIf $imUpload = 6 Then
                    _IEFormElementSetValue($descriptionimfield, $Image6_Description)
                    If Not @error Then
                        ; MsgBox("Success", "Email Input Filled", "Next Step!")
                    Else
                        ;MsgBox("Failed", "Email Input Not Filled", "Try Again!")
                        Exit
                    EndIf
                EndIf


                ;Go to Next page!
                $oButtons = _IETagNameGetCollection($ksl, "input")
                For $oButton In $oButtons
                    If String($oButton.value) = "Upload File" Then
                        _IEAction($oButton, "click")
                        ;MsgBox("Success", "Login Successful!", "Login Credentials Verified!")
                        ExitLoop
                    Else
                    EndIf
                Next
                Sleep(2000)
            Until $imUpload = $ImageCounter

 

Here Is The Form Code i am Trying To Use IT On In IE

<DIV id=bodyCol1 sizcache06735652359028728="138" sizset="0"><DIV style="WIDTH: 424px; FLOAT: left; MARGIN: 0px 0px 10px">
<STYLE type=text/css>.announcement_box {
    FONT-SIZE: 14px; WIDTH: 615px; BACKGROUND: #eee; FLOAT: left; FONT-WEIGHT: bold; PADDING-BOTTOM: 10px; PADDING-TOP: 10px; PADDING-LEFT: 10px; CLEAR: left; MARGIN: 0px 0px 20px; PADDING-RIGHT: 10px
}
.announcement_box A {
    TEXT-DECORATION: none
}
</STYLE>

<DIV class=announcement_box><FONT color=#aa0000>UPDATE:</FONT> Services is now part of <A href="http://local.ksl.com/?s_cid=services">KSL Local</A> with more categories and added features.<BR>To take full advantage of KSL Local be sure to <A href="http://local.ksl.com/merchant/locations">add your business</A> today. Service ads posted outside of KSL Local will be deleted.<BR></DIV>
<DIV style="CLEAR: both"></DIV></DIV>
<DIV style="WIDTH: 424px; FLOAT: left; MARGIN: 0px 0px 10px"><!-- Hack -->
<SCRIPT type=text/javascript>
 $(document).ready( function() {
 $('#3').attr('disabled', 'disabled');
 $('#4').attr('disabled', 'disabled');
 $('.element:eq(3)').append(
 ' <a href="index.php?nid=1126">Change »</a>'
 );
 $('.element:eq(4)').append(
 ' <a href="index.php?nid=1126">Change »</a>'
 );
 } );
</SCRIPT>
</DIV>
<DIV id=bodyCol2><!-- ===================[ STORY PAGES ]================= --><!-- ===================[ STORY MEDIA ]================= --><!-- ===================[ STORY RELATED ]================= --><!-- ===================[ STORY RELATED ]================= --><!-- ===================[ STORY GALLERIES ]================= --></DIV>
<SCRIPT language=JavaScript type=text/javascript>
function addInputs()
{
    var oNewNode = document.createElement("div");
    oNewNode.setAttribute("style","padding-top: 5px;");
    document.getElementById('attr_fields').appendChild(oNewNode);
    oNewNode.innerHTML="<input type=\"text\" name=\"text[]\" id=\"text[]\" size=\"25\" \/>";
//      document.getElementById('attr_fields').innerHTML="<input type=\"text\" name=\"text[]\" id=\"text[]\" size=\"25\" \/>";
}

var mediaCount = 0;

// ================================================================
function addMedia(ctrlID,divID,inputName,limit)
{
    var name = "media_"+mediaCount;
    var oNewNode = document.createElement("div");

    oNewNode.setAttribute("style","padding-top: 3px;");
    oNewNode.setAttribute("id",name);
    document.getElementById(divID).appendChild(oNewNode);
    oNewNode.innerHTML="<input name=\""+inputName+"[]\" type=\"file\" /> <a href=\"#\" onClick=\"delMedia('"+ctrlID+"','"+name+"')\">Remove</a>";

    mediaCount++;

    if (document.getElementById(divID).childNodes.length >= limit) {
        document.getElementById(ctrlID).style.display = "none";
    }
    //      document.getElementById('attr_fields').innerHTML="<input type=\"text\" name=\"text[]\" id=\"text[]\" size=\"25\" \/>";
}
// ================================================================
function delMedia(ctrlID,name)
{
    var oNode = document.getElementById(name);
    oNode.parentNode.removeChild(oNode);

    mediaCount--;
    document.getElementById(ctrlID).style.display = "block";
}

var subName;

// ================================================================
function setCat(cName,sName,col,tId)
{
    var sNode = document.getElementById(sName);
    var cIndex = document.getElementById(cName).selectedIndex;
    var cValue = document.getElementById(cName).options[cIndex].value;

    //alert(cValue);

    //sNode.style.background = "#ddd";
    sNode.options[1] = new Option("[Loading Options]", "", false, false);
    sNode[1].selected = true;

    subName = sName;
    $('#throbber-'+subName).css('display','inline');

    //document.getElementById("rmiCmd").src = "/scripts/cat_options.php?col="+col+"&tid="+tId+"&nid="+cValue;
    $.get('/scripts/cat_options2.php', { col: col, tid: tId, nid: cValue }, setSub2, 'json');
}
// ================================================================
function setSub2(d) {
    var sub = $('#'+subName);
    $('#throbber-'+subName).css('display','none');

    if(d.result == 'error') return;

    //sub.css('background-color','#ffffff');
    sub.empty();

    sub.append('<option value="">Select a Sub-Category</option>');
    for(i in d.categories) {
        var v = d.categories[i].split('|');
        sub.append('<option value='+v[0]+'>'+v[1]+'</option>');
    }
}
// ================================================================
function setSub(doc) {
    var sNode = document.getElementById(subName);
    var rmiData = doc.getElementById('rmiData').innerHTML;
    var aItems = rmiData.split("|");
    var aVals;

    sNode.style.background = "#fff";

    //var tNode = document.getElementById("id_text");
    //tNode.value = rmiData;

    for (var x = 0; x < (aItems.length -1); x ++) {
        aVals = aItems[x].split("=");
        sNode.options[x+1] = new Option(aVals[1],aVals[0],false,false);
    }

    sNode.length = x+1;
    sNode[0].selected = true;
}
// ================================================================
function start_upload(id)
{
    $('#d-'+id).css('background-color', '#ccc');
    $('.throbber').css('display', 'inline');
}
// ================================================================
function stop_upload(id, src, desc, alt)
{
    var html = '';
    var idx = $('#u-'+id+' div.photo').length;

    if(src == false) {
        alert("Error: "+desc);
    }
    else {
        html = '<div class="photo"><div class="operations"><button class="photo-up" onclick="photo_up(this)">Move up</button> <button class="photo-down" onclick="photo_down(this)">Move down</button> <button class="photo-delete" onclick="photo_delete(this)">Delete</button></div><img class="thumbnail" src="'+src+'?filter=ksl/newhl"><div class="title"><span class="title-prefix">Photo:</span> '+alt+'</div><div><span class="title-prefix">Description:</span> <span class="description">'+desc+'</span></div><div><button class="photo-edit" onclick="photo_edit_description(this)">Edit description</button></div></div>';
        $('#u-'+id).append(html);
    }

    // clear the form
    $('#d-'+id).css('background-color', 'white');
    $('#f-'+id).get(0).reset();
    $('.throbber').css('display', 'none');
}
// ================================================================
function photo_up(e)
{
    var src = $(e).parent().parent();
    var dst = $(src.prev());

    if(dst.length == 0)
        return;

    var srcidx = src.prevAll().length;
    var dstidx = srcidx-1;

    // perform API call
    $.post('/resources/form/airlock_api.php',
            { cmd: 'move_media', source: 'airlock', aid: '71621910', from: srcidx, to: dstidx },
            function (d) {
                if(d.result != 'success')
                    return;

                $(src).insertBefore(dst);
            },
            'json'
    );
}
// ================================================================
function photo_down(e)
{
    var src = $(e).parent().parent();
    var dst = $(src.next());

    if(dst.length == 0)
        return;

    var srcidx = src.prevAll().length;
    var dstidx = srcidx+1;

    // perform API call
    $.post('/resources/form/airlock_api.php',
            { cmd: 'move_media', source: 'airlock', aid: '71621910', from: srcidx, to: dstidx },
            function (d) {
                if(d.result != 'success')
                    return;

                $(src).insertAfter(dst);
            },
            'json'
    );
}
// ================================================================
function photo_delete(e)
{
    var src = $(e).parent().parent();
    var index = src.prevAll().length;

    // perform API call
    $.post('/resources/form/airlock_api.php',
            { cmd: 'delete_media', source: 'airlock', aid: '71621910', index: index },
            function (d) {
                if(d.result != 'success')
                    return;

                src.remove();
            },
            'json'
    );
}
// ================================================================
function photo_edit_description(e)
{
    var src = $(e).parent().parent();
    var index = src.prevAll().length;

    var desc = src.find('.description');
    var odesc = desc.text();
    var ndesc = prompt('Please enter the description for the photo:', odesc);

    if(ndesc == null)
        return;

    // perform API call
    $.post('/resources/form/airlock_api.php',
            { cmd: 'edit_media', source: 'airlock', aid: '71621910', index: index, desc: ndesc },
            function (d) {
                if(d.result != 'success')
                    return;

                desc.text(ndesc);
            },
            'json'
    );
}
// ================================================================
function supports_html5_storage()
{
    try {
        return 'localStorage' in window && window['localStorage'] !== null;
    } catch (e) {
        return false;
    }
}
// ================================================================
function send_id()
{
    //20110427 - BH
    //this causes double posting in the classifieds, as it resubmits anything in the airlock a second time.

    return;

    var id;

    if(!supports_html5_storage())
        return;

    id = localStorage.getItem('ddmId');
    if(id == null) {
        id = Math.round(Math.random()*10000000);
        localStorage.setItem('ddmId', id);
    }

    $.post('/resources/form/airlock_api.php',
           { cmd: 'set_id', source: 'airlock', aid: '71621910', id: id},
           function(){},
           'json'
          );
}
// ================================================================
$(document).ready(function(){
    send_id();
});
</SCRIPT>

<STYLE type=text/css>.barBox {
    FONT-SIZE: 14px; HEIGHT: 21px; BORDER-RIGHT: #000 1px solid; WIDTH: 620px; FONT-WEIGHT: normal; COLOR: #fff; TEXT-ALIGN: center; MARGIN-LEFT: 0px; CLEAR: left; BORDER-LEFT: #000 1px solid
}
.bar1 {
    HEIGHT: 21px; BACKGROUND: url(/images/barBackRed.gif) no-repeat right top; FLOAT: left
}
.bar2 {
    HEIGHT: 21px; BACKGROUND: url(/images/barFrontRed.gif) no-repeat right top; FLOAT: left
}
.bar3 {
    HEIGHT: 21px; BACKGROUND: url(/images/barBackGrey.gif) no-repeat right top; FLOAT: left
}
.bar4 {
    HEIGHT: 21px; BACKGROUND: url(/images/barBackGrey.gif) no-repeat left top; FLOAT: left
}
.bar5 {
    HEIGHT: 21px; BACKGROUND: url(/images/barFrontRed.gif) no-repeat left top; FLOAT: left
}
.barLabels {
    FONT-SIZE: 12px; HEIGHT: 21px; WIDTH: 332px; FONT-WEIGHT: bold; COLOR: #666; TEXT-ALIGN: center; PADDING-TOP: 5px; MARGIN-LEFT: 10px; CLEAR: left
}
.barBottom {
    HEIGHT: 40px; FLOAT: left; TEXT-ALIGN: left
}
.barText {
    POSITION: relative; LEFT: -6px; TOP: 4px
}
.formDivider {
    FONT-SIZE: 14px; MARGIN-BOTTOM: 15px; BORDER-TOP: #ccc 1px solid; HEIGHT: 20px; WIDTH: 620px; BACKGROUND: #eeeeee; MARGIN-TOP: 10px; FONT-WEIGHT: bold; PADDING-BOTTOM: 0px; PADDING-TOP: 3px; PADDING-LEFT: 7px; CLEAR: left; PADDING-RIGHT: 0px
}
.imageBox {
    MARGIN-BOTTOM: 5px; MARGIN-TOP: 5px; FLOAT: left; MARGIN-RIGHT: 10px
}
.help {
    FONT-SIZE: 10px
}
.boxOk {
    MARGIN-TOP: 4px
}
.boxErr {
    BORDER-TOP: #900 1px solid; BORDER-RIGHT: #900 1px solid; BACKGROUND: #fbb; MARGIN-TOP: 4px; BORDER-BOTTOM: #900 1px solid; PADDING-BOTTOM: 2px; PADDING-TOP: 2px; PADDING-LEFT: 2px; BORDER-LEFT: #900 1px solid; PADDING-RIGHT: 2px
}
.boxStatic {
    FONT-SIZE: 14px; MARGIN-TOP: 4px; FONT-WEIGHT: bold
}
.optionBox {
    MARGIN-BOTTOM: 8px; MARGIN-TOP: 3px
}
.submitBox {
    CLEAR: both; MARGIN: 5px 0px 0px 2px
}
.element {
    MARGIN-BOTTOM: 3px; WIDTH: 585px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px; PADDING-LEFT: 0px; CLEAR: left; PADDING-RIGHT: 0px
}
.elementFloat {
    MARGIN-BOTTOM: 4px; FLOAT: left; MARGIN-RIGHT: 10px
}
.iLabel {
    FONT-SIZE: 12px; WIDTH: 120px; FLOAT: left; FONT-WEIGHT: normal; PADDING-BOTTOM: 0px; TEXT-ALIGN: left; PADDING-TOP: 0px; PADDING-LEFT: 0px; MARGIN: 4px 0px 0px 5px; DISPLAY: block; PADDING-RIGHT: 0px
}
.gBox {
    OVERFLOW: hidden; WIDTH: 625px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px; PADDING-LEFT: 0px; MARGIN: 0px 0px 15px; PADDING-RIGHT: 0px
}
.gTitle {
    FONT-SIZE: 18px; BORDER-TOP: #ccc 1px solid; WIDTH: 620px; FONT-WEIGHT: bold; PADDING-BOTTOM: 5px; PADDING-TOP: 5px; PADDING-LEFT: 0px; MARGIN: 0px 0px 12px; PADDING-RIGHT: 0px
}
.gBody {
    WIDTH: 590px; PADDING-BOTTOM: 5px; PADDING-TOP: 0px; PADDING-LEFT: 20px; PADDING-RIGHT: 15px
}
IFRAME.uploader {
    HEIGHT: 0px; WIDTH: 0px; DISPLAY: none
}
.photos {
    MARGIN-LEFT: 5px; CLEAR: both
}
.operations {
    FLOAT: right
}
.operations SPAN {
    COLOR: blue
}
.photos DIV.photo {
    MARGIN-BOTTOM: 8px; HEIGHT: 77px; BORDER-BOTTOM: #ccc 1px dashed; PADDING-BOTTOM: 9px; PADDING-TOP: 2px; MIN-HEIGHT: 77px
}
.photos INPUT {
    FONT-SIZE: 10px
}
.photos IMG {
    FLOAT: left; MARGIN-RIGHT: 10px
}
.photos .title-prefix {
    FONT-WEIGHT: bold
}
.photos BUTTON {
    FONT-SIZE: 80%; BORDER-TOP: #aaa 1px solid; BORDER-RIGHT: #aaa 1px solid; BORDER-BOTTOM: #aaa 1px solid; BORDER-LEFT: #aaa 1px solid; BACKGROUND-COLOR: #e6e6e6; -webkit-border-radius: 3px; -moz-border-radius: 3px
}
.photos BUTTON:hover {
    BORDER-TOP: #0073ea 1px solid; BORDER-RIGHT: #0073ea 1px solid; BORDER-BOTTOM: #0073ea 1px solid; COLOR: white; BORDER-LEFT: #0073ea 1px solid; BACKGROUND-COLOR: #0073ea
}
.photos BUTTON.photo-edit {
    MARGIN-TOP: 3px
}
.photos .thumbnail {
    HEIGHT: 75px; WIDTH: 100px
}
.throbber {
    DISPLAY: none
}
#HomeDetails {
    DISPLAY: none
}
</STYLE>

<DIV style="CLEAR: both"></DIV>
<DIV class=gBox sizcache06735652359028728="138" sizset="0">
<DIV style="FONT-SIZE: 14px; FLOAT: left; FONT-WEIGHT: bold; COLOR: #777; MARGIN: 0px 0px 2px">KSL Classifieds - Utah's Fastest Growing Classifieds Website</DIV>
<DIV style="FONT-SIZE: 20px; FONT-WEIGHT: bold; CLEAR: left; MARGIN: 0px 0px 10px">Place a FREE Classified Ad</DIV>
<DIV style="MARGIN: 0px 0px 10px">
<DIV class=barBox>
<DIV class=bar1 style="WIDTH: 137px"><SPAN class=barText><SPAN style="FONT-SIZE: 11px">Create the Ad</SPAN></SPAN></DIV>
<DIV class=bar1 style="WIDTH: 124px"><SPAN class=barText><SPAN style="FONT-SIZE: 11px">Contact Info</SPAN></SPAN></DIV>
<DIV class=bar2 style="WIDTH: 124px"><SPAN class=barText><SPAN style="FONT-SIZE: 11px">Add Photos</SPAN></SPAN></DIV>
<DIV class=bar3 style="WIDTH: 124px"><SPAN class=barText><SPAN style="FONT-SIZE: 11px">Terms of Use</SPAN></SPAN></DIV>
<DIV class=bar4 style="WIDTH: 111px"><SPAN class=barText><SPAN style="FONT-SIZE: 11px">Thank You</SPAN></SPAN></DIV></DIV></DIV>
<DIV>
<DIV class=gBody></DIV></DIV>
<DIV id=PhotoUpload>
<DIV class=gTitle>Photo Upload</DIV>
<DIV class=gBody id=PhotoUpload>
<DIV class=element>
<P><B>Note:</B> The first photo will be used as the primary photo and will represent your ad in the listings, so make sure it's the best photo you have. Use the buttons to the right of each image to change the ordering. </P><BR></DIV>
<DIV class=element>
<DIV class=photos id=u-142></DIV>
<FORM id=f-142 onsubmit=start_upload(142) action=/resources/form/upload.php encType=multipart/form-data method=post target=i-142 jQuery170540162545780766="5"><INPUT name=nid type=hidden value=640> <INPUT name=sid type=hidden value=4516794> <INPUT name=fid type=hidden value=563456> <INPUT name=source type=hidden value=airlock> <INPUT name=aid type=hidden value=71621910> <LABEL class=iLabel for=142>File:</LABEL> <INPUT name=MAX_FILE_SIZE type=hidden value=10000000> <INPUT name=142 class=boxOk id=142 type=file><BR></DIV></FORM>
<FORM id=f-142 onsubmit=start_upload(142) action=/resources/form/upload.php encType=multipart/form-data method=post target=i-142 jQuery170540162545780766="5">
<DIV class=element><LABEL class=iLabel for=d-142>Description:</LABEL> <TEXTAREA name=d-142 class=boxOk id=d-142 style="HEIGHT: 50px; WIDTH: 400px; BACKGROUND-COLOR: white" wrap=soft></TEXTAREA> </DIV>
<DIV class=element><LABEL class=iLabel for=s-142></LABEL><INPUT name=s-142 id=s-142 type=submit value="Upload file"> <IMG width=16 height=16 class=throbber style="DISPLAY: none" src="/graphics/throbber.gif"> <BR><IFRAME name=i-142 class=uploader id=i-142 src="">
                </IFRAME></FORM>
<SCRIPT type=text/javascript>
                //$(document).ready(function () {
                    $('#f-142').submit(function () { $('#f-142').attr('target','i-142'); });
                //});
                </SCRIPT>
 <A href="index.php?nid=1126">Change »</A></DIV></DIV></DIV>
<DIV id=PhotoTips sizcache06735652359028728="138" sizset="0">
<DIV class=gTitle>Photo Tips</DIV>
<DIV class=gBody id=PhotoTips sizcache06735652359028728="138" sizset="0">
<DIV class=element sizcache06735652359028728="138" sizset="0">
<DIV style="PADDING-BOTTOM: 7px; PADDING-LEFT: 15px" sizcache06735652359028728="138" sizset="0">
<LI>Submitted images must be in JPG or GIF format.</LI>
<LI>Although all submitted images will automatically be resized to <SPAN style="FONT-WEIGHT: bold">640x480</SPAN> pixels, we recommend resizing your images to these dimensions before you upload them to avoid any potential problems. Click <A href="http://www.ksl.com/?nid=391&amp;sid=651805" target=_new>HERE</A> for instructions on how to do this.</LI>
<LI>If resizing your images, as recommended above, does not help, then try submitting the ad with no images and then add the rest later using the edit function in "My Ads".</LI></DIV> <A href="index.php?nid=1126">Change »</A></DIV></DIV></DIV></DIV>
<FORM action=/index.php?nid=640&amp;form_3=16&amp;form_4=467 encType=multipart/form-data method=post><INPUT name=nid type=hidden value=640> <INPUT name=sid type=hidden value=4516794> <INPUT name=fid type=hidden value=563456> 
<DIV class=submitBox><INPUT name=back class=submitBox type=submit value="<< Back Page"> <INPUT name=next class=submitBox type=submit value="Next Page >>"> </DIV></FORM>
<STYLE type=text/css>.mediaright {
    MARGIN-BOTTOM: 3px; WIDTH: 202px; FLOAT: right; MARGIN-LEFT: 15px
}
.medialeft {
    MARGIN-BOTTOM: 3px; WIDTH: 202px; FLOAT: left; MARGIN-RIGHT: 30px
}
.sidebarright {
    FONT-SIZE: 12px; WIDTH: 180px; BORDER-BOTTOM: #ccc 1px solid; FLOAT: right; COLOR: #000; PADDING-BOTTOM: 7px; PADDING-TOP: 0px; PADDING-LEFT: 0px; MARGIN: 0px 0px 10px 10px; PADDING-RIGHT: 0px
}
.sidebarleft {
    FONT-SIZE: 12px; WIDTH: 180px; BORDER-BOTTOM: #ccc 1px solid; FLOAT: left; COLOR: #000; PADDING-BOTTOM: 7px; PADDING-TOP: 0px; PADDING-LEFT: 0px; MARGIN: 0px 10px 10px 0px; PADDING-RIGHT: 0px
}
.sidebarleft UL {
    PADDING-BOTTOM: 0px; PADDING-TOP: 0px; PADDING-LEFT: 30px; MARGIN: 0px; PADDING-RIGHT: 0px
}
.sidebarright UL {
    PADDING-BOTTOM: 0px; PADDING-TOP: 0px; PADDING-LEFT: 30px; MARGIN: 0px; PADDING-RIGHT: 0px
}
.divboxleft {
    FONT-SIZE: 12px; MARGIN-BOTTOM: 3px; BORDER-TOP: black 1px solid; BORDER-RIGHT: black 1px solid; WIDTH: 202px; BORDER-BOTTOM: black 1px solid; FLOAT: left; PADDING-BOTTOM: 6px; PADDING-TOP: 6px; PADDING-LEFT: 6px; BORDER-LEFT: black 1px solid; PADDING-RIGHT: 6px; MARGIN-RIGHT: 15px
}
.divboxright {
    FONT-SIZE: 12px; MARGIN-BOTTOM: 3px; BORDER-TOP: black 1px solid; BORDER-RIGHT: black 1px solid; WIDTH: 202px; BORDER-BOTTOM: black 1px solid; FLOAT: right; PADDING-BOTTOM: 6px; PADDING-TOP: 6px; PADDING-LEFT: 6px; MARGIN-LEFT: 15px; BORDER-LEFT: black 1px solid; PADDING-RIGHT: 6px
}
.divboxleft UL {
    OVERFLOW: auto; PADDING-BOTTOM: 5px; PADDING-TOP: 5px; PADDING-LEFT: 15px; MARGIN: 0px 0px 0px 10px; PADDING-RIGHT: 0px
}
.divboxright UL {
    OVERFLOW: auto; PADDING-BOTTOM: 5px; PADDING-TOP: 5px; PADDING-LEFT: 15px; MARGIN: 0px 0px 0px 10px; PADDING-RIGHT: 0px
}
.divboxleft FONT {
    FONT-SIZE: 11px
}
.divboxright FONT {
    FONT-SIZE: 11px
}
.ksltableleft {
    FONT-SIZE: 11px; MARGIN-BOTTOM: 10px; MARGIN-TOP: 5px; FLOAT: left; MARGIN-RIGHT: 15px
}
.ksltableright {
    FONT-SIZE: 11px; MARGIN-BOTTOM: 10px; MARGIN-TOP: 5px; FLOAT: right; MARGIN-LEFT: 15px
}
.ksltable {
    BORDER-COLLAPSE: collapse
}
.ksltable TD {
    FONT-SIZE: 11px; BORDER-TOP: black 1px solid; BORDER-RIGHT: black 1px solid; BORDER-BOTTOM: black 1px solid; PADDING-BOTTOM: 2px; TEXT-ALIGN: center; PADDING-TOP: 3px; PADDING-LEFT: 7px; BORDER-LEFT: black 1px solid; PADDING-RIGHT: 7px
}
.ksltable TH {
    FONT-SIZE: 11px; BORDER-TOP: black 1px solid; BORDER-RIGHT: black 1px solid; BORDER-BOTTOM: black 1px solid; PADDING-BOTTOM: 2px; TEXT-ALIGN: center; PADDING-TOP: 3px; PADDING-LEFT: 7px; BORDER-LEFT: black 1px solid; PADDING-RIGHT: 7px
}
.ksltable TH {
    FONT-SIZE: 12px; FONT-WEIGHT: bold; COLOR: #fff; PADDING-BOTTOM: 4px; TEXT-ALIGN: center; PADDING-TOP: 5px; BACKGROUND-COLOR: #0b162f
}
SPAN#widgetclose:hover {
    CURSOR: pointer
}
</STYLE>
<!-- ===================[ STORY HEAD : INTRO ]================= -->
<DIV id=storyIntro></DIV><!-- HERE HERE --><!-- Google Analytics -->
<SCRIPT>
  (function(i,s,o,g,r,a,m){ i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-70949446-4', 'auto');
  ga('send', 'pageview');

</SCRIPT>
</DIV>

 

Edited by rm4453
Added Code For Webpage Form I am Trying It on.

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

  • Similar Content

    • Valnurat
      By Valnurat
      How can I get combobox value by using  the ENTER key?
    • vyperhand
      By vyperhand
      I'm struggling to launch a VBS file via autoit using RunWait.  Due to the nature of the deployment tool I am using for said script, I only know that the .vbs files will be in the same directory as my AutoIt-generated .exe, but not what that path will be.  The path will look something like this:
      c:\programdata\vendor\lots\of\folders\randomnumber
      This is generated during deployment and I have no way of predicting the path - therefore, I am not sure how to call back to "same directory" in order to successfully launch the .vbs.
      This line is as close as I have gotten - this fires off the cmd window, but it closes immediately with out information, and the .vbs is not launched.
      RunWait (@ComSpec & " /c" & 'cscript.exe WORKPLEASE.vbs ALL /Q /NoCancel') I thought /c might be the problem, but leaving out the /c element causes me not to even see the momentary CMD window flash by.  Any help will be greatly appreciated, and thanks in advance.
    • Valnurat
      By Valnurat
      I have a ComboBox and I want, when I start writting in it, that it will show me what is the first in the list.
      Like, is I start writting:
      "pe" it  should show me "peter" if that is the first in the list.
      How can I do that?
       
      While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idClos ExitLoop Case $idComboBox $sComboRead = GUICtrlRead($idComboBox) Local $iIdx = _ArraySearch($aResult,$sComboRead,0,0,0,0,1,1) Local $aComputerOwner = _AD_GetObjectsInOU("OU=al,DC=AD,DC=AL,DC=ORG","(&(objectclass=computer)(managedby=" & $aResult[$iIdx][0] & "))",Default,"cn") _ArrayDelete($aComputerOwner,0) _GUICtrlListView_SetItemCount($idMylist,UBound($aComputerOwner)) If IsArray($aComputerOwner) Then For $i = 0 To UBound($aComputerOwner) - 1 GUICtrlCreateListViewItem($aComputerOwner[$i], $idMylist) Next Else GUICtrlSetData($idMylist, "No computer|") EndIf EndSwitch WEnd  
    • Valnurat
      By Valnurat
      Hi.
      I'm trying to add an array to my gui listview, but it fails with
      "C:\Program Files (x86)\AutoIt3\Include\GuiListView.au3" (473) : ==> Array variable has incorrect number of subscripts or subscript dimension range exceeded.: DllStructSetData($tBuffer, "Text", $aItems[$iI][0]) DllStructSetData($tBuffer, "Text", ^ ERROR My code is:
      #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.2 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <WindowsConstants.au3> #include <ComboConstants.au3> #include <GuiComboBox.au3> #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <MsgBoxConstants.au3> #Include <AD.au3> #include <Array.au3> Opt('MustDeclareVars', 1) Global $aResult[0][2] Local $aNames[4] = ["DKSO","DKKO","SELU","SEES"] Local Const $iWidth = 300, $iHeight = 250, $iW = 85, $iH = 25 Local $hGUI = GUICreate("Find Computer Owner", $iWidth, $iHeight) ; Create a combobox control. Local $idComboBox = GUICtrlCreateCombo("", 2, 2, 296, 20, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL, $WS_VSCROLL, $CBS_SORT)) ;$WS_VSCROLL Local $idMylist = GUICtrlCreateListView("", 2, 114, 296, 100) Local $idClos = GUICtrlCreateButton("Close", ($iWidth - $iW) / 2, ($iHeight - $iH) - 7 , $iW, $iH) _AD_Open() Local $sFill = "" For $i = 0 to UBound($aNames) -1 Local $aUserInfo = _AD_GetObjectsInOU("OU=Al,DC=ad,DC=al,DC=org","(&(objectCategory=Person)(objectclass=user)(sAMAccountName=" & $aNames[$i] & "*))","","distinguishedName,cn") if @error Then MsgBox(0,@error,@extended) Exit EndIf For $x = $aUserInfo[0][0] To 1 Step -1 If $aUserInfo[$x][0] = "" Or StringInStr($aUserInfo[$x][0], "Resources") > 0 Or StringInStr($aUserInfo[$x][0], "Leavers") > 0 Or StringInStr($aUserInfo[$x][0], "Administration") > 0 Then _ArrayDelete($aUserInfo, $x) EndIf Next _ArrayConcatenate($aResult, $aUserInfo, 1) Next for $i = 0 To UBound($aResult) -1 If $aResult[$i][0] <> "" Then $sFill &= $aResult[$i][1] & "|" EndIf Next _ArrayDisplay($aResult, 'AD ' & UBound($aResult)) $sFill = StringTrimRight($sFill, 1) _GUICtrlComboBox_BeginUpdate($idComboBox) GUICtrlSetData($idComboBox, $sFill, "") _GUICtrlComboBox_EndUpdate($idComboBox) GUISetState(@SW_SHOW, $hGUI) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") _GUICtrlListView_AddColumn($idMylist, "Computername", 296) Local $sComboRead = "" ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idClos ExitLoop Case $idComboBox $sComboRead = GUICtrlRead($idComboBox) Local $iIdx = _ArraySearch($aResult,$sComboRead,0,0,0,0,1,1) Local $aComputerOwner = _AD_GetObjectsInOU("OU=al,DC=AD,DC=AL,DC=ORG","(&(objectclass=computer)(managedby=" & $aResult[$iIdx][0] & "))",Default,"cn") _ArrayDelete($aComputerOwner,0) _ArrayDisplay($aComputerOwner) _GUICtrlListView_SetItemCount($idMylist,UBound($aComputerOwner)) If IsArray($aComputerOwner) Then MsgBox(0,"Test",$sComboRead) _GUICtrlListView_AddArray($idMylist, $aComputerOwner) ; <---- it fails Else GUICtrlSetData($idMylist, "No computer|") EndIf EndSwitch WEnd _AD_Close() ; Delete the previous GUI and all controls. GUIDelete($hGUI) Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo ; Local $tBuffer $hWndListView = $idMylist If Not IsHWnd($idMylist) Then $hWndListView = GUICtrlGetHandle($idMylist) $tNMHDR = DllStructCreate($tagNMHDR, $lParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndListView Switch $iCode Case $NM_DBLCLK ; Sent by a list-view control when the user double-clicks an item with the left mouse button $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam) _DebugPrint("$NM_DBLCLK" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ "-->Code:" & @TAB & $iCode & @CRLF & _ "-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @CRLF & _ "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _ "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _ "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _ "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _ "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _ "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @CRLF & _ "-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags")) ; No return value EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY Func _DebugPrint($s_Text, $sLine = @ScriptLineNumber) ConsoleWrite( _ "!===========================================================" & @CRLF & _ "+======================================================" & @CRLF & _ "-->Line(" & StringFormat("%04d", $sLine) & "):" & @TAB & $s_Text & @CRLF & _ "+======================================================" & @CRLF) EndFunc ;==>_DebugPrint Do I do it wrong?
       
      Thank you in advanced.
    • Robdog1955
      By Robdog1955
      I'm trying to click a button on a web page. I have added a couple of MsgBox lines to allow me to watch what happens on the page. As you can see the first half of my script enters data into text boxes on the page. I have no problem there. I just cannot click on the region buttons. The "set focus" line causes an outline to appear around the EU button and the "click button" line causes the "Pick a Region" text to disappear. Here is the code I have so far.
      #include <IE.au3> Local $oIE = _IECreate("http://questchecker.com/") Local $iQuestID = "123456" Local $sCharacterName = "CharacterName" Local $colForms = _IEFormGetCollection($oIE) $iCount = 0 For $oForm In $colForms $oFormElements = _IEFormElementGetCollection($oForm) For $oFormElement In $oFormElements $iCount = $iCount + 1 Local $sTagName = StringLower($oFormElement.tagName) Local $sElementType = $oFormElement.type Local $sElementName = $oFormElement.name Switch $iCount Case 6 _IEFormElementSetValue($oFormElement, "MyRealm", 0) ; realm Case 7 _IEFormElementSetValue($oFormElement, $sCharacterName, 0) Case 8 _IEFormElementSetValue($oFormElement, $iQuestID, 0) EndSwitch Next Next Local $oButtons = _IEGetObjByName($oIE, "questForm") For $oButton In $oButtons If _IEFormElementGetValue($oButton) = "US" Then MsgBox(0, "", "Click Okay to set focus") _IEAction($oButton, "focus") MsgBox(0, "", "Click Okay to click button") _IEAction($oButton, "click") ExitLoop EndIf Next MsgBox(0, "", "Click Okay to quit") _IEQuit($oIE) Exit