ASP + Alert box, passing a value

Posted on 2004-10-07
Last Modified: 2006-11-17
I have an ASP page form that has an input field called 'bid'

<input name="bid" type="text"  size="30">

Once a bid amount is entered and then the submit button clicked, I would like an alert box to pop up and say.

You are placing a bid in the amount of XYZ.  With XYZ being the amount they entered in the input box.

This is what I have so far but it obviously does not work.

<input name="bid" type="text"  size="30">

<input type="submit"   value="Submit"   onClick="alert('You are placing a bid in the amount of '">

Or, is there a better way to do this ?

Question by:pgooseman
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +2
LVL 23

Expert Comment

ID: 12252076
You could use javascript onsubmit event instead...
LVL 12

Accepted Solution

kingsfan76 earned 25 total points
ID: 12252105
the word "documnet" should spell "document"

besides that, it should work.  just make sure you spell the form name correctly, and make sure that "bid" input is inside the <form></form> tag

Assisted Solution

hansam earned 25 total points
ID: 12252113
function SendBid(){
alert("You are placing a bid in the amount of ";

<input name="bid" type="text"  size="30">

<input type="button"   value="Submit"   onClick="SendBid();">
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

LVL 19

Expert Comment

ID: 12252129
This code works for me (Note that you had spelled "document" wrong in your original post):

<form name=form1>
  <input name="bid" type="text"  size="30">
  <input type="submit"   value="Submit"   onClick="alert('You are placing a bid in the amount of '">

LVL 19

Expert Comment

ID: 12252139
@kingsfan76 -- sorry for the repost!  No harm inteded.  

LVL 23

Expert Comment

ID: 12252141
Looks like you can get your current mthod working but if all fails check here for an alternative method: 
LVL 12

Expert Comment

ID: 12252312

no harm taken  :)


Author Comment

ID: 12253796
Thanks for the help.

One last question.

I set it up as a function and it works fine.  However, when I click "Ok" it does not submit the form.

Here is the code.

<!--hide script from older browsers

// JavaScript to verify bid

function SendBid()
confirm("You are about to submit a bid in the amount of $" + +  "\n Tax will be appplied to your  bid");


//end script-->

Do I have to put in a return false or return true somewhere ?

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Error in query expression 3 56
ASP Classic - JavaScript - Get value from form in iFrame and pass to main page. 2 39
ASP exit 10 33
ASP Classic - Read XML File inner content 10 69
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
In an interesting question ( here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question