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 6167303
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:29:18+00:00 2026-05-23T22:29:18+00:00

i have a input area and a button like this: <input type=text name=text_name id=txt_name

  • 0

i have a input area and a button like this:

<input type="text" name="text_name" id="txt_name" size="30" maxlength="70">
<input type=button id="btnPublishAction" onclick="publishFeed()" value="Yeah" style="margin: 5px 0;" />

and a function like this:

    name = oForm.elements["text_name"].value;

    function publishFeed() {
var act = new gigya.services.socialize.UserAction();        
act.setUserMessage(name);
act.setLinkBack("http://www.xxx.com");      
act.setTitle("Check me out!");      
act.setDescription("This is my Profile"); 
act.addMediaItem( { 
    src: '<?php echo $photoDiv; ?>',
    href: 'http://www.exploretalent.com/<?php echo $_SESSION['talent_username'];?>',
    type: 'image'
});
var params = 
    {
        userAction:act, 
        scope: 'internal',
        privacy: 'public',
        callback:publishAction_callback
    };
gigya.services.socialize.publishUserAction(conf, params);
}

what i am trying to do is when i click Yeah the value from the text_name to be set into act.setUserMessage(name); where name = oForm.elements["text_name"].value;.

i found this syntax name = oForm.elements["text_name"].value; but not sure if that works

any ideas?
Thanks

  • 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-23T22:29:19+00:00Added an answer on May 23, 2026 at 10:29 pm

    Assuming oForm is a reference to a form on your page. And assuming your textarea is contained in that form. And assuming your textarea has a name attribute of “text_name”, then yes, that should work. Just drop that line of code into your function as the first line.

    function publishFeed() {
        var name = oForm.elements["text_name"].value;
        var act = new gigya.services.socialize.UserAction();        
        act.setUserMessage(name);
        ...
    }
    

    With name = ... above the function, the name variable is not updated when the text changes. You want to set the value of that variable within your function so that you are getting the current text.

    Edit: If you don’t want to use a form on your page, then give your textarea an id and access it via that id:

    <textarea id="myTextArea"></textarea>
    

    Here’s the update JavaScript:

    function publishFeed() {
        var name = document.getElementById("myTextArea").value;
        var act = new gigya.services.socialize.UserAction();        
        act.setUserMessage(name);
        ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a text area that I want to change the font size of
I have a PHP Script which has several text areas. What I would like
Added tinyMCE as inline editor. Have a next probllem : first time this is
I have this jquery function to automatically replace sertain characters with others: jQuery(function() {
I have a seperate JFrame where there is a text box (jTextArea) that takes
I have another question for the masses out there regarding trying to input values
I have the following table: <table width=1000 border=1 cellpadding=2 cellspacing=2 bordercolor=#CCCCCC class=WebApps id=addIssue> <tbody>
I have written a PHP script which allows me to modify and update a
I'm thinking about adding an openid widget to a toolkit I'm developing. An important

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.