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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:06:20+00:00 2026-05-27T11:06:20+00:00

var $contact_title = $(‘#contact_title’).val(); var $contact_summary = $(‘#bbcode’).val(); I retreive a text area and

  • 0
var $contact_title = $('#contact_title').val();
var $contact_summary = $('#bbcode').val();

I retreive a text area and text field then I do this:

$contact_title.val('');
$contact_summary.val('');

Nnone of them get emptied

HTML:

<form action="" method="get">
    <table border="0">
        <tr>
            <td valign="top">Title:</td>
            <td>
                <input name="title" type="text" style="width:710px" id="contact_title" />
            </td>
        </tr>
        <tr>
            <td valign="top">Message:</td>
            <td>
                <textarea name="request" cols="30" rows="20" id="bbcode"></textarea>
            </td>
        </tr>
        <tr>
            <td colspan="2" align="right" >
                <input name="send" type="button" onClick="clicked()" value="Send" />
            </td>
        </tr>
    </table>
</form>
  • 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-27T11:06:21+00:00Added an answer on May 27, 2026 at 11:06 am

    You should store the element in your variable and not the value.

    So, your code should be:

    var $contact_summary = $('#bbcode');
    $contact_summary.val('');
    

    Btw, it’s a good practice to use unobtrusive javascript and bind your click event outside of your html markup:

    $('button').click(function() { //clear inputs });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

nothing is being sent with $.post function clicked() { var $contact_title=$(#contact_title); var $contact_summary=$(#bbcode); alert($contact_title.val());//
var currentClassName = $(this).parent('td').next('td').find('input:text').attr('class'); if (currentClassName == undefined) { currentClassName = $(this).parent('td').find('input:text').attr('class'); } This
Hi I open UI dialog this way: function openDialog(page, heightPar, title) { var $dialog1
i open UI dialog in this way: var $dialog = jQuery('#dialog'); $dialog.load('mySite.aspx'); $dialog.dialog({ autoOpen:
jQuery: $(#contact-us-form).submit(function () { var nameVal = $(input[name=name]).val(); var companyVal = $(input[name=company]).val(); var titleVal
I have the following code to make a jsonp call. var contacts; $.ajax({ url:
var imageDisplayed = Ti.UI.createImageView({ image : somefile.png, height:'100', width:'100' }); I have created the
var str=itss[BACK][BACK][BACK][BACK][BACK][BACK] it's a test stringgg[BACK][BACK]; var word = '[BACK]'; var substrings = str.split(word);
var Stars = new Array(1,2,3,4,5,6,7,8,9,10); var StarsX = new Array(451,455,460,470,490,100,160,220,280,300); var StarsY = new
var jsn=getAttr(ref,json-data).toString(); console.log(jsn); //{test: true,stringtest:hallo}. it's OK. JSON.parse(jsn); //Uncaught SyntaxError: Unexpected token s, line:

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.