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

  • SEARCH
  • Home
  • 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 8374595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:57:25+00:00 2026-06-09T14:57:25+00:00

Preapring for a Facebook competition while I have spare time, the Publish function with

  • 0

Preapring for a Facebook competition while I have spare time, the Publish function with facebook has a once posted javascript function that you can define.

What I am looking to do is call a function to write a value unto a php form which will then be posted and submitting data into a database. I have tested to the extent that I know the idea is sound just calling a basic alert, I am just not sure how to get from calling the function to writing the value into the form.

This value I need to be able to call on in the page that the data is being posted to, to base an “if function” off, basically if “True/Yes” then I need it to process another php script in addition to the data its posting to the database

What I have now is:

  <script type="text/javascript">
    function isShared()
    {
    alert("Yes");
    }
  </script>
<input class="fieldbox" name='shared' type='hidden' value="value of 'display_alert()'"/>

I know it cannot be an alert, but this is pretty much where my current javascript skills leave me stranded.

  • 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-06-09T14:57:26+00:00Added an answer on June 9, 2026 at 2:57 pm
    <script type="text/javascript">
    function isShared()
    {
        document.getElementById('xshared').value = 'Yes';
    }
    </script>
    <input class="fieldbox" id="xshared" name="shared" type="hidden" value="" />
    

    This will add the value Yes To the hidden field once isShared is called.

    Are you looking to have the form automatically posted without the user clicking anything but the share button? The only reason I ask is that it sounds like what you are looking for is AJAX, to post data to the database silently without the need of the user to navigate away from their current page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While preparing for the SCJP-6 exam I faced with a difficult issue. I can’t
I'm preparing a presentation about JavaScript in different browsers. I know that there are
I'm preparing my paypal system and have a separate page that forwards the user
I have a situation here I am preparing a custom post for facebook like
While preparing to deploy a MongoDB powered site to a clients web server, their
I am preparing to start on a new short-term contract (1-2 months) that involves
I am preparing for my interview and came across this question: Consider that i
I am preparing an Excel sheet in which I have to maintain the version
I am preparing a short tutorial for level 1 uni students learning JavaScript basics.
Am prepapring to upgrade our devexpress libs. I noticed that they say their latest

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.