www.webdeveloper.com
Results 1 to 3 of 3

Thread: From the submit form to the javascript

  1. #1
    Join Date
    May 2012
    Posts
    6

    Unhappy From the submit form to the javascript

    I have a submit form in the forum (PHPBB):

    HTML Code:
    <form id="postform" method="post" action="./posting.php?mode=post&amp;f=1" enctype="multipart/form-data"> 
    <div id="message-box"> 
    <textarea name="message" id="message" rows="15" cols="76" tabindex="4" class="inputbox"></textarea> 
    </div> 
    <input type="submit" accesskey="s" tabindex="6" name="post" value="Submit" class="button1 default-submit-action" />
    </form>
    And special javascript using API:

    Code:
    VK.api('wall.post',{ message: "Here must be text from the submit form", attachment: "" },function(data) { });
    }
    Its necessary to copy a text from the submit form (textarea name="message" id="message") to the value of 'message' for the above javascript when you click on the Submit button.

    Any ideas? JS-parser? Ajax? Thanx

  2. #2
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,648
    this "VK.api" lloks like JQuery's $.post('url',{params},callback);

    HTML Code:
    <input type="submit" accesskey="s" tabindex="6" name="post" value="Submit" class="button1 default-submit-action" onclick="sendSpam(this.form)" />
    Code:
    function sendSpam(form){
    var txt=form.message.value;
    VK.api('wall.post',{ message: txt, attachment: "" },function(data) {here goes your callback function});
    }
    xxx: Guess Buddhist riddle: "What is the sound of one hand clapping?"
    yyy: facepalm

  3. #3
    Join Date
    May 2012
    Posts
    6
    thank u so much!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles