Jump to content
AlienStar

set checkbox as checked in wordpress ??

Recommended Posts

AlienStar

hello everybody 

as you read in the topic title; I need to set checkbox as checked but it's not included in a form !!

here is my code:

 

#include <IE.au3>

$url = "https://engnajjar.wordpress.com/wp-admin/post-new.php"

$oIE =_IECreate($url)

_IEFormElementCheckBoxSelect($oIE, 8, "category-8", 1)

 

here is the part of html page source which contains checkbox 

<div class="inside">
    <div id="taxonomy-category" class="categorydiv">
        <ul id="category-tabs" class="category-tabs">
            <li class="tabs"><a href="#category-all">all categories</a></li>
            <li class="hide-if-no-js"><a href="#category-pop">most usedً</a></li>
        </ul>

        <div id="category-pop" class="tabs-panel" style="display: none;">
            <ul id="categorychecklist-pop" class="categorychecklist form-no-clear" >
                
        <li id="popular-category-7" class="popular-category">
            <label class="selectit">
                <input id="in-popular-category-7" type="checkbox"  value="7"  />
                iron            </label>
        </li>

                    </ul>
        </div>

        <div id="category-all" class="tabs-panel">
            <input type='hidden' name='post_category[]' value='0' />            <ul id="categorychecklist" data-wp-lists="list:category" class="categorychecklist form-no-clear">
                
<li id='category-1'><label class="selectit"><input value="1" type="checkbox" name="post_category[]" id="in-category-1" /> Uncategorized</label></li>

<li id='category-5'><label class="selectit"><input value="5" type="checkbox" name="post_category[]" id="in-category-5" /> transit</label></li>

<li id='category-6'><label class="selectit"><input value="6" type="checkbox" name="post_category[]" id="in-category-6" /> cars</label></li>

<li id='category-7' class="popular-category"><label class="selectit"><input value="7" type="checkbox" name="post_category[]" id="in-category-7" /> iron</label></li>

<li id='category-8'><label class="selectit"><input value="8" type="checkbox" name="post_category[]" id="in-category-8" /> tools</label></li>
            </ul>
        </div>
                <div id="category-adder" class="wp-hidden-children">
                <a id="category-add-toggle" href="#category-add" class="hide-if-no-js taxonomy-add-new">add</a>
                <p id="category-add" class="category-add wp-hidden-child">
                    <label class="screen-reader-text" for="newcategory">add</label>
                    <input type="text" name="newcategory" id="newcategory" class="form-required form-input-tip" value="name" aria-required="true"/>
<select  name='newcategory_parent' id='newcategory_parent' class='postform' >
    <option class="level-0" value="1">Uncategorized</option>
    <option class="level-0" value="5">transit</option>
    <option class="level-0" value="6">cars</option>
    <option class="level-0" value="7">iron</option>
    <option class="level-0" value="8">tools</option>
</select>
                    <input type="button" id="category-add-submit" data-wp-lists="add:categorychecklist:category-add" class="button category-add-submit" value="add" />
                    <input type="hidden" id="_ajax_nonce-add-category" name="_ajax_nonce-add-category" value="33ccee5dc8" />                    <span id="category-ajax-response"></span>
                </p>
            </div>
            </div>
    </div>
</div>

 

please help

 

 

Edited by AlienStar

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

×