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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:25:56+00:00 2026-05-30T00:25:56+00:00

<script language=’javascript’ type=’text/javascript’ charset='<?=$page_charset?>’> $(document).ready(function(){ $(‘#btn_login’).click(function(){ $.search_keyword(); }); }); here is the script <form

  • 0
<script language='javascript' type='text/javascript' charset='<?=$page_charset?>'>
    $(document).ready(function(){

        $('#btn_login').click(function(){
            $.search_keyword();
        });
    });

here is the script

<form name='frm_search_keyword'>
<table style='width:250px;'>
    <tr>
        <td style='width:100px;'>
            Search 
        </td>
        <td>
            <input type="text" name="web_keyword" />
        </td>
        <td>
            <input type="submit" id="btn_login" name="btn_login" value="search!" />
        </td>
    </tr>
</table>
</form> 

here is the form

search_keyword:function(type)
{
    $.ajax({
        type: 'POST',
        url: '/web_keyword',
        data: {'b_type':type},
        cache: false,
        async: false,
        success: function(result){
            if(result == 12001)
            {
                alert('please choose your interest.');
                location.href = '/account/interest';
            }else
                location.href = '/'+type+'/'+result;
        }
    });
}

It successfully sends ‘web_keyword’ to db query and get result.
but I can’t get type data through ajax script.
Can you help me to ‘type’ data from the form table to ajax script?

Thank you.

  • 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-30T00:25:57+00:00Added an answer on May 30, 2026 at 12:25 am

    I’m not exactly sure if this is the problem, but it is suspect:

     $('#btn_login').click(function(){
            $.search_keyword();
        });
    

    Where is “type” supposed to come from? What is “type” referring to? Is “type” a value returned from your DB query? Or is it something selected by the user when they perform the search?

    If type is something within your form element, then use Javascript or jQuery, or whatever, to “harvest” that value from the page, and then you will need to pass that data to the AJAX functionality.

    $('#btn_login').click(function(){
            //First get the "type" value, for example if "type" is retrieved from the form element
            var type = $('#btn_login').attr('type'); //this is for example's sake, since you did not assign an id to this form element...
            search_keyword(type);
        });
    

    You just need to get “type” from where ever it is being generated and/or stored and pass it to your AJAX function.

    Also, maybe this is irrelevant, but your “search_keyword()” function definition looks odd to me…

    Instead of:

    search_keyword:function(type){...}
    

    Should be:

    search_keyword = function(type){...}
    

    One final thing, could you tell us which Javascript library you are using?

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

Sidebar

Related Questions

See example: <!DOCTYPE html> <html> <head> <title>language</title> <script type=text/javascript src=http://www.google.com/jsapi> </script> </head> <body> <div
<html> <head> <script language = javascript> show = function() { document.getElementById(name).innerHTML = window.opener.game.pl.guild.n; var
<SCRIPT Language = JavaScript> function calculate() { a = 12 b = eval(document.form.number.value) c
I have this simple code that speaks for itself. <script language='javascript"> function check() {}
I'm using script language ChaiScript with c++ and Qt. I've defined such function: void
I have this script on my html page: <script language='javascript'>parent.resizeTo(550,510);</script> I'd like to add
I'm registering a javascript in aspx.net Dim script = <script language = javascript> &
Does anyone know if there is any language detection script/library available for javascript? I
I have written a simple brainfuck interpreter in MATLAB script language. It is fed
Does anybody have a PHP (or other language) script for drawing a spiral. A

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.