Saturday, September 17, 2022
HomeWordPress Developmentplugins - Find out how to entry values from your individual settings...

plugins – Find out how to entry values from your individual settings web page in javascript?


I added could personal settings web page for my plugin with php. Moreover I have to entry the values from two inputFields from the settings web page after somebody clicks on a submit button on the general public web page. My click on motion for the submit button is a javascript file.

There may be simply the error, that the factor cannot be discovered.

Code to get the worth:

var kasUser = doc.getElementById("kasUserName").innerHTML
var kasPas = doc.getElementById("kasPsw").innerHTML

Code from the settings web page:

perform JG_SiteEditor_settings_page() {
?>
<div class="wrap">
<h2>JG SiteEditor API Settings</h2>

<type methodology="publish" motion="choices.php">
    <?php settings_fields( 'JG-SiteEditor-settings-group' ); ?>
    <?php do_settings_sections( 'JG-SiteEditor-settings-group' ); ?>
    <desk class="form-table">
        <tr valign="high">
        <th scope="row">Kasserver API Benutzername</th>
        <td><enter kind="textual content" title="userName" id="kasUserName" worth="<?php echo esc_attr( get_option('userName') ); ?>" /></td>
        </tr>
        
        <tr valign="high">
        <th scope="row">Kasserver API Passwort</th>
        <td><enter kind="password" title="password" id="kasPsw" worth="<?php echo esc_attr( get_option('password') ); ?>" /></td>
        </tr>
    </desk>
    
    <?php submit_button(); ?>

</type>
</div>
<?php

}

Thanks for any assist.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments