 |
| Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

May 5th, 2010, 10:11 AM
|
|
Authorized User
|
|
Join Date: Apr 2009
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Need help with image onclick function
Click event on image doesn't fire the any kind of alert message box.
Can anyone please help what I am doing wrong?
<formname="edit"action="abc_edit.asp"method="POST"onsubmit="return add_onSubmit()">
<tableborder="0"cellpadding="10"cellspacing="0">
function chkAmount(txtamount,txtamountb,x,y,z)(
errorcheck = 0;
if (Number(txtamount) + Number(y) >= Number(x)){
alert("Message 1 !");
errorcheck =1;
}
if (errorcheck == 1) {
return false;
}
if (Number(txtamountb) + Number(z) >= Number(x)){
alert("Message 2 !");
errorcheck =1;
}
if (errorcheck == 1) {
return false;
}
}
<td><inputtype="Text"name="name1"value="<%=name1%>"size="40"onchange="Javascript: return checkAmount(document.edit.name1.value,<%=x %>,<%=y%>);"></td>
<td><inputtype="Text"name="name2"value="<%=name2%>"size="40"onchange="Javascript: return checkAmountB(document.edit.name2.value,<%=x %>,<%=z%>);"></td>
<td>
<inputTYPE="image"src="/images/a.gif"onMouseover="src="/images/a.gif""onMouseout="src="/images/a.gif""VALUE="Save"id="image1"name="image1"onclick="Javascript: return chkAmount(document.edit.name1.value,document.edit. name2.value,<%=x%>,<%=y%>,<%=z%>);">
</td>
</table>
</form>
|
|

May 5th, 2010, 06:32 PM
|
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
You need much more help than you think. You need to look at all your code an place some spaces in lots of places EG:
<formname should be <form name
<inputType should be <input type
I dont think this page will display anything except for printiing your Javascript to the browser. where are you <script> and </script> tags
.
Sorry I dont have time to re-write your page. Are you saying it runs and loads?
__________________
Wind is your friend
Matt
|
|

May 6th, 2010, 07:59 AM
|
|
Authorized User
|
|
Join Date: Apr 2009
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks for looking into it...but I fixed the issue...
|
|

May 6th, 2010, 07:06 PM
|
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
No worries. Hey I dont say this to be rude however.....If you solve an issue you post here let people know. You will frustrate people on forums if they spend time helping you when its not neccessary. I mean if I had the time I may have re-written your code, lets face it, the whole thing needed to be re-written. I have not seen a page in an ASP forum before with so many simple HTML issues.
__________________
Wind is your friend
Matt
|
|

May 7th, 2010, 08:01 AM
|
|
Authorized User
|
|
Join Date: Apr 2009
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Sorry about the frustration but as soon as I solve it I put a comment that I solved it.
|
|

May 8th, 2010, 06:33 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Quote:
|
I have not seen a page in an ASP forum before with so many simple HTML issues.
|
This is not the original code, but a serious bug in this forum's editor. Whenever you paste colored code from, say, Visual Studio and forget to wrap it in code tags, the editor deletes the spaces....
Imar
|
|
 |