Using Jquery to edit a web app item


hi all,


i'm trying work out if it's possible edit web app item using jquery $.post() function.

i want able create buttons automatically update web-app field, without leaving/reloading page.

if possible, there seem endless posibilities web-app interaction enhance functionality.

any appreciated...

 

here's i've got far...

 

<script>

$(document).ready(function(){

    $("#mybutton").click(function(){

          $.post("/customcontentprocess.aspx?a=editsave&ccid=16033&oid={module_oid}&otype={module_otype}",{

               cat_custom_251597:somenewfieldcontenthere,

               });

    });

});

</script>

 

the url i'm posting taken source of web-app's edit layout template:
          /customcontentprocess.aspx?a=editsave&ccid=16033&oid={module_oid}&otype={module_otype}

 

in browser gets rendered follows, looks right me, think.

          $.post("/customcontentprocess.aspx?a=editsave&ccid=16033&oid=1252216&otype=35",{

 

cat_custom_251597 name , id of field want edit source of web-app's edit layout also.

i'm presuming correct way send data customcontentprocess.aspx ???

 

really appreciate if can this.

many thanks,

 

adrian

hi adrian,

 

modify webapp edit layout according instructions here: http://kb.worldsecuresystems.com/851/cpsid_85119.html, tweak: replace under step 3 with:

 

<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>

<script type="text/javascript">

 

function jqsub() {

 

var $form = $('#standard_edit'); // set form id

var $messagebox = $('#mess123'); // set message box id

var $successmessage = "<h3>thank submission!</h3>"; // replace own success message in html format

var $errormessage = "<h3>error - please try again</h3>"; // replace own error message in html format

 

$.ajax({

                type: 'post',

                url: $form.attr('action'),

                data: $form.serialize(),

                success: function (msg) {

        if (typeof msg == "string") {

 

                        $messagebox.append($successmessage)

                        $messagebox.fadein();

                       

                      

                               

    

                }

                }})};

</script>

 

kind regards,

alex



More discussions in How to - HTML / CSS / JavaScript


adobe

Comments

Popular posts from this blog

Upgrade 3.4.8 to 3.5.1 failed "download package failed" - Joomla! Forum - community, help and support

Joomal 3.6.3 update error - PHP temporary folder is not set - Joomla! Forum - community, help and support

Fatal error during instalation - Joomla! Forum - community, help and support