Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6730375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:24:05+00:00 2026-05-26T10:24:05+00:00

Please give me some suggestions, I was trying to run following code : <

  • 0

Please give me some suggestions, I was trying to run following code :

< form name="form1" action="some_action" method="post" onsubmit="somefunction(); return false;">

.... some code...

< input type="submit" value="GET">

< /form>

Here, I want to run onsubmit (which is running well and as expected giving some dialog box as output, working fine)

Then I want to run action which is not running (because of return false in onsubmit) but I want to run it as well by any way.

< form action="login/buy_artifact/0/<?=$row['A_ID']?>/<?=$userid?>" onSubmit="return btn(<?=$i?>,<?=$row['A_ID']?>,<?=$userid?>);">

< input type="submit" name="submit" value=" GET ">
< /form>

function btn(id,art_id,user_id)
    {   
    //alert("called"+id);
      var id=id;
      var name = document.getElementById("name"+id).innerHTML; 
      var desc = document.getElementById("description"+id).innerHTML;
      var credit = document.getElementById("creditsforquestion"+id).innerHTML;

      var art_id=art_id;
      var user_id=user_id;

      // Only send param data for sample. These parameters should be set
      // in the callback.
      var order_info = { "name":name,
                         "description":desc,
                         "credit":credit,
                         "aid":art_id,
                         "uid":user_id
                       };

      // calling the API ...
      var obj = {
        method: 'pay',
        order_info: order_info,
        purchase_type: 'item'
      };

      FB.ui(obj, callback);     
    var callback = function(data) {

      if (data['order_id']) {

        writeback("Transaction Completed! </br></br>"
        + "Data returned from Facebook: </br>"
        + "<b>Order ID: </b>" + data['order_id'] + "</br>"
        + "<b>Status: </b>" + data['status']);

      } else if (data['error_code']) {

        writeback("Transaction Failed! </br></br>"
        + "Error message returned from Facebook:</br>"
        + data['error_message']);
        return false;
      } else {

        writeback("Transaction failed!");
      }

    };

    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T10:24:05+00:00Added an answer on May 26, 2026 at 10:24 am

    You could do this:

    <form name="form1" action="some_action" method="post" onsubmit="return somefunction();">
        .... some code...
        <input type="submit" value="GET" />
    </form>
    

    and then in your somefunction decide whether to return true or false based on some condition:

    function somefunction() {
        if (....) {
            // do something and return true in order to submit the form
            return true;
        } else {
            // do not submit the form
            return false;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can you please give some suggestions on sqlite using on the iPhone? Within my
Please give me some suggestions regarding a project topic in the TLA+ language. I'm
Please give me some suggestions about how to change a NSString variable. At my
Anybody please give some useful links on this topic.i need to create a content
Can you please give me some comparison between C compilers especially with respect to
What does $+ in a GNU makefile mean? Also, please give me some good
I am trying to code and style a box which will contain a post.
Please give me the direction of the best guidance on the Entity Framework.
Please give me the advantages and disadvantages of using the particular framework. Can give
Please give me a real time example for singleton pattern . Different threads accessing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.