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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:01:11+00:00 2026-05-24T20:01:11+00:00

How can i display an alert message or alert box when getting the information(not

  • 0

How can i display an alert message or alert box when getting the information(not submitting)

i have few form structures(text type) in my html when i enter the id in one of the form and press get button all the other forms will be filled based on the form submitted.

for the above i am using json and jquery

Ex:

Jquery

$(document).ready(function(){
$("#button1").click(function(){
$.post('script_1.php', { id: $('input[name="id"]', '#myForm').val() },
function(json) { 
$("input[name='title']").val(json.title);
$("input[name='name']").val(json.name); 
$("input[name='age']").val(json.age);
$("#institution").val(json.institution); 
}, "json");
 });

json:

 $abc_output = array('title' => $row['title'],'name' => $row['name'],'age' => $row['age'], 'institution' => $row['institution']);
 echo json_encode($abc_output);

now the problem is all the id’s will not be having information so when the user enters some id with no information pop up or alert box need to be submitted saying no id.

How can i do that?

Note: as it is get info the result will be displayed on the same page, if its submit i could have echoed id not found in DB in the server side php(script_1.php) which is not the case here.

Html:

 id: <input type="text" name="id"/>
 <div id="hidden" style="display: none;">
 <p>Title:<input type="text" name="title"/></p>
 <p>name:<input type="text" name="rno"/></p>
 <p>age:<input type="text" name="age"/></p>
  Institution: <select id="institution" name="institution">
  <option value="None">-- Select --</option>
  <option value="ab">ab</option>
   <option value="bc">bc</option> 
   </select>

  </div>
  <br/> 
 <input type="button" id="button1" value ="Get Info" onclick="document.getElementById('hidden').style.display = '';"/> 

 </form>
 <div id="age"></div>
 </body>
 </html>
  • 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-24T20:01:12+00:00Added an answer on May 24, 2026 at 8:01 pm

    It may be helpful to set up an AJAX error handler, to handle things like session timeouts, json ‘parseerror’, etc.

    $(document).ajaxError(function() {
     alert( "Triggered ajaxError handler." );
    });
    

    This can help you to determine if the problem is with the success callback not being called.

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

Sidebar

Related Questions

Here's the response: {Message:Authentication failed.,StackTrace:null,ExceptionType:System.InvalidOperationException} how can i display an alert box with the
Can anyone tell me why I keep getting the else and alert is not
I have using android alert dialog builder to display the some user message(String) as
Can anyone tell me how I can display a status message like 12 seconds
Using CoreFoundation, I can display an alert dialog with the following: CFUserNotificationDisplayAlert(0.0, kCFUserNotificationPlainAlertLevel, NULL,
How can I display an alert after a user clicks a submit button in
I'm trying to display an alert message for the users in a catch block.
I want to display a alert message when a user clicks on button. I
I have a webpage that has a comment box that can be toggled by
I want to display alert message and then refresh the page. But it take

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.