<input type="button"> fails to pass name="" and value=""

I am writing a shopping cart application that uses both select boxes and buttons on the same page to submit variables and values to a Perl script.  I am using javascript to submit information to the script.  I have created a script that I have confidence accurately reads what is being passed thru the browser to the application and find that the select boxes work fine but the buttons fail to pass their information.  

Here are sample select and button tags.

<select name="choice1" onChange="javascript:document.workorder.submit()">
<option value="choose" selected>Choose Service:
<option value="men">Men's
<option value="women">Women's
<option value="summarize">Review Order
<option value="checkout">Check Out
</select>

<input type="button" name="b1" value="Clear All" onclick="javascript:document.workorder.submit()"><input type="button" name="b2" value="Subtotal" onclick="javascript:document.workorder.submit()"><input type="button" name="b3" value="Add To Order" onclick="javascript:document.workorder.submit()"><input type="button" name="b4" value="Check Out" onclick="javascript:document.workorder.submit()">

I find that the buttons do submit all other information to the Perl script,  just not their name-value pair.

Mercy!

Shearer-ServicesAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DesertWarriorCommented:
you should create a function to separate each action...

<input type="button" name="b1" value="Clear All" onclick="CallPage(1)"><input type="button" name="b2" value="Subtotal" onclick="CallPage(2)"><input type="button" name="b3" value="Add To Order" onclickonclick="CallPage(3)"><input type="button" name="b4" value="Check Out" onclick="CallPage(4)">


function CallPage(action)
{
if (action == 1) //meaning the user clicked on Clear All
{
      document.workorder.action = NameOfThePageToCall.asp?action=1
      document.workorder.submit()
}
if (action == 2) //meaning the user clicked on SubTotal
{
      document.workorder.action = NameOfThePageToCall.asp?action=2
      document.workorder.submit()
}
if (action == 3) //meaning the user clicked on Add To Order
{
      document.workorder.action = NameOfThePageToCall.asp?action=3
      document.workorder.submit()
}
if (action == 4) //meaning the user clicked on CheckOut
{
      document.workorder.action = NameOfThePageToCall.asp?action=4
      document.workorder.submit()
}
}

and then on the Page that receives all the information you do a Request.Querystring("action") to know the value and to be able to manage what do to...
0
jaysolomonCommented:
>>>onclickonclick="CallPage(3)"><

should be (and probaly a typo) onclick="CallPage(3)"
0
DesertWarriorCommented:
yeah
i'm a ctrl C, ctrl V maniac
thanks :)
0
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

Shearer-ServicesAuthor Commented:
So if I answer my own question, do I get the points?  LOL

I pulled the code out of the script to remove any other conflicts that might cause the problem and created a new page.  By changing the input tag type to submit and removing the onclick="java*" I can now pass name-value pairs for all controls and related variables.   The changed portion of the code looks like this:

<input type="submit" name="b1" value="Clear All" >
<input type="submit" name="b2" value="Subtotal" >
<input type="submit" name="b3" value="Add To Order">
<input type="submit" name="b4" value="Check Out">

Thanks for the help.
0
DesertWarriorCommented:
:/
this is a weird way of programming
anyways,
u do as u wish
0
YZlatCommented:
are your <select> and buttons inside the <form> tags?
0
LunchyCommented:
PAQed, with points refunded (250)

Lunchy
Friendly Neighbourhood Community Support Admin
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Fonts Typography

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.