Hi all!
I'm very appreciative that someone have come out with such a method to go around IE7's prompt bug as shown in the below link, but I don't really know how to use it. http://www.hunlock.com/blogs/Working...ug,_er_feature
This is what I did and the bottom one is my original section of my javascript code, but I think I use it wrongly. - <script type='text/javascript' src='IEprompt.js'></script>
-
<script type='text/javascript'>
-
-
function promptCallback("") {
-
-
alert("Enter the number of Lucky Dip Chances you want to buy.");
-
-
location='<?=tep_href_link(FILENAME_LUCKY_DIP, '', 'SSL')?>';
-
-
} else {
-
location="luckydip.php?osCsid=<?=$_GET['osCsid']?>&action=purchase&qty=" + number;
-
}
-
-
IEprompt("How many Lucky Dip Chances you want to buy?.", "");
-
</script>
-
Original:: - <script>
-
-
function main() {
-
-
var input = prompt("How many Lucky Dip Chances you want to buy?.", "");
-
-
var number = input;
-
-
if(number == "") {
-
-
alert("Enter the number of Lucky Dip Chances you want to buy.");
-
-
location='<?=tep_href_link(FILENAME_LUCKY_DIP, '', 'SSL')?>';
-
-
} else {
-
location="luckydip.php?osCsid=<?=$_GET['osCsid']?>&action=purchase&qty=" + number;
-
}
-
-
}
-
-
</script>
-
-
I just started learning javascript, so I'm sorry that I don't understand the terminology. Sorry about that. This is previously how I link to the front page, upon using yout script, can we retain the link: <a href="javascript :main()"> ?
Thank you so much!
Warmest Regards,
Gordon
9 2085 acoder 16,027
Recognized Expert Moderator MVP
Welcome to TSDN!
Try: - function promptCallback(number) {
-
if (number == "") {
-
alert("Enter the number of Lucky Dip Chances you want to buy.");
-
-
location='<?=tep_href_link(FILENAME_LUCKY_DIP, '', 'SSL')?>';
-
-
} else {
-
location="luckydip.php?osCsid=<?=$_GET['osCsid']?>&action=purchase&qty=" + number;
-
}
-
}
-
IEprompt("How many Lucky Dip Chances you want to buy?.", "");
-
Hi there, Thank you so much for your help, but the page just refresh and there were no effects.
I've changed it to : - <script type='text/javascript' src='IEprompt.js'></script>
-
<script type='text/javascript'>
-
-
function promptCallback(number) {
-
-
if(number == "") {
-
-
alert("Enter the number of Lucky Dip Chances you want to buy.");
-
-
location='<?=tep_href_link(FILENAME_LUCKY_DIP, '', 'SSL')?>';
-
-
}
-
-
else {
-
location="luckydip.php?osCsid=<?=$_GET['osCsid']?>&action=purchase&qty=" + number;
-
}
-
-
IEprompt("How many Lucky Dip Chances you want to buy?.", "");
-
-
}
-
-
</script>
-
This time round i can see the IE7 prompt to go around the problem of IE7's prompt bug for javascript. However, it just blink once and I was not able to type in any values.
Is it because the way I link which may create problems too like what i did below?
[HTML]<td width="50%" align="center"><b><a href="javascript :promptCallback()">Click here to buy 1 Lucky Dip Chance for <?=getCostPerLuckyDip()?> PV</a><br>Note: Lucky dip chances are not refundable for PVs.</b></td>
[/HTML]
Thank you so much for your help, sorry for my "newbie" skills.
acoder 16,027
Recognized Expert Moderator MVP
Is it because the way I link which may create problems too like what i did below?
[HTML]<td width="50%" align="center"><b><a href="javascript:promptCallback()">Click here to buy 1 Lucky Dip Chance for <?=getCostPerLuckyDip()?> PV</a><br>Note: Lucky dip chances are not refundable for PVs.</b></td>
[/HTML]
You need to call IEPrompt, not promptCallback.
Yup it works, but however the first prompt was undefined, the sentence I type in IE prompt came out in a blink after i enter any value.
Thanks once again!
acoder 16,027
Recognized Expert Moderator MVP
What does your full code look like now?
What does your full code look like now?
i separate into 2 parts as in between there are other codings: - <script type='text/javascript' src='IEprompt.js'></script>
-
<script type='text/javascript'>
-
-
function promptCallback(number) {
-
-
if(number == "") {
-
-
alert("Enter the number of Lucky Dip Chances you want to buy.");
-
-
location='<?=tep_href_link(FILENAME_LUCKY_DIP, '', 'SSL')?>';
-
-
}
-
-
else {
-
-
location="luckydip.php?osCsid=<?=$_GET['osCsid']?>&action=purchase&qty=" + number;
-
-
}
-
-
IEprompt("How many Lucky Dip Chances you want to buy?.", "");
-
-
}
-
-
</script>
-
The second part where the javascript is called in is:
[HTML]<form action="luckydip.php?action=bid&osCsid=<?=$_GET['osCsid']?>" method="post">
<table border="0" width="100%" cellspacing="0" cellpadding="0" bgcolor="#1484d2">
<tr>
<td>
<table border="0" width="100%" cellspacing="1" cellpadding="3" class="luckyDipContents">
<tr>
<td width="50%" align="center"><b>Your Lucky Dip Chances:</b> <?=getNumChances($_SESSION['customer_email_address'])?></td>
<td width="50%" align="center"><b><a href="javascript :main()">Click here to buy 1 Lucky Dip Chance for <?=getCostPerLuckyDip()?> PV</a><br>Note: Lucky dip chances are not refundable for PVs.</b></td>
</tr>[/HTML]
Hope this will be clearer in assessing the error.
acoder 16,027
Recognized Expert Moderator MVP
Change main() to: - function main() {
-
IEprompt("How many Lucky Dip Chances you want to buy?.", "");
-
}
promptCallback should get called automatically.
Change main() to: - function main() {
-
IEprompt("How many Lucky Dip Chances you want to buy?.", "");
-
}
promptCallback should get called automatically.
Thank you so much man!!! It works perfectly. hehe. I'm trying on other stuff, i'll ask around for help if needed. This community rocks!!!
acoder 16,027
Recognized Expert Moderator MVP
You're welcome. Glad it helped.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: lawrence |
last post by:
I'm a beginner with Javascript and especially cross-browser
Javascript. I got this working in IE, but not in Netscape 7. It seems
like, in Netscape, every time I click on a button, the focus shifts...
|
by: sea |
last post by:
I have administration client installed on one computer and the full
version of db2 installed on the server -- this is DB2 7.2 workgroup
edition, fixpak 7. On the server I can go to the command...
|
by: Rog |
last post by:
Hello,
I went to
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/dnaspp/html/aspnet-
usingtreeviewiewebcontrol.asp
and saved down the TreeviewControl.msi file and also...
|
by: Rog |
last post by:
Hello,
Yesterday I downloaded IEwebcontrols.exe and
TreeviewControl.msi
from
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/dnaspp/html/aspnet-...
|
by: joemac |
last post by:
I'm just starting out with javascript and the following is not working
as it should. The expected prompt dialog box never appears.
<head>
<script language="JavaScript"><!--
var name;...
| |
by: Jeff |
last post by:
I feel like I should have been able to figure this out but I can't seem
to find any references on this topic.
It seems like my current working directory is consistently a few
directories up from...
|
by: Dabbler |
last post by:
My gridview Delete command works until I install a confirm prompt as follows,
then it does nothing.
Any suggestions would be appreciated!
protected void MyGridView_RowCreated( object sender,...
|
by: Ja NE |
last post by:
(as first - thank you for all your help several years ago, and second - please
apologise me for my clumsy enlgish)
so, preface: some users on my photo related site sometimes enter (link) giant...
|
by: gregerly |
last post by:
Hello All,
I'm a PHP programmer pretending to be a python programmer right now. I'm playing around with the interactive prompt via putty on my server and am getting the hang of the syntax and...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |