Avatar of jsuanque
jsuanque
Flag for Australia asked on

Java script (ShowConfirm) does not show in Firefox browser

Hello Experts,
On my web page i have  abutton that when a user clicks does invoke a java show confirm message. This message pops up when you are using IE browser but with Firefox it doesn't.
Anyone please shed some light on this
Thanks
JavaASP.NETC#

Avatar of undefined
Last Comment
jsuanque

8/22/2022 - Mon
jsuanque

ASKER
Here's my code...

    <script language="javascript"  type="text/jscript">
 
    function ShowConfirm(textBox)
    {
   
        var confirmtext ="Thank you! ...Your Registration number is: ";
        return confirm(confirmtext + textBox.value);
    }
    </script>
hosneylk

how are you calling the function?
jsuanque

ASKER
Hello Hosneylk,
On a button click.

Cheers,
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
hosneylk

Can I see how? i.e. the code you are using to call the function.
Manish

onclick="ShowConfirm(document.formName.textBoxName)"
Manish

also check is javascript enable in mozilla.?
Edit> Preference> COntent...
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
jsuanque

ASKER
Hello Karanw,
javascript is enabled. As for onclick currently our code does something ...
#################
                                <asp:Button ID="NSOEF_EXT_Preview_Form_Button" runat="server" BackColor="Silver" Font-Bold="True" Font-Names="Tahoma" Font-Size="Small" ForeColor="Black" Style="z-index: 186; left: 544px; position: absolute; top: 920px" Text="Print Preview" Width="96px" OnClick="Declaration_to_PrintPreviewt_BTN_Click"/>


#################

    protected void Declaration_to_PrintPreviewt_BTN_Click(object sender, EventArgs e)
    {
        con = new SqlConnection(ConfigurationManager.ConnectionStrings["STUDENT_MASTER_INDEXConnectionString"].ConnectionString);

        cmd = new SqlCommand("SMI_P003_NSOEF_EXT_Declaration_Main", con);
        cmd.CommandType = CommandType.StoredProcedure;

        cmd.Parameters.Add("@EnrolID", SqlDbType.VarChar).Value = NSOEF_EXT_Declaration_Back_EnrolID_TB.Text;
        cmd.Parameters.Add("@Active", SqlDbType.VarChar).Value = '1';
        cmd.Parameters.Add("@StuEmergCont1Title", SqlDbType.VarChar).Value = NSOEF_EXT_StuEmergCont1Title_DDL.Text;

        con.Open();
        cmd.ExecuteNonQuery();

        int newIdentity = int.Parse(cmd.Parameters["@EnrolID"].Value.ToString());
        Response.Redirect("NSOEFP_EXT_Print.aspx?newid=" + newIdentity.ToString());
hosneylk

so where's the call to ShowConfirm?
jsuanque

ASKER
Sorry guys for taking so long...can i request this not to be abandoned since i just got back from a motorcycle accident.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
jsuanque

ASKER
Hi Hosneylk/ Karanw,

Here's the one that calls it and it's included in Page_Load

    protected void Page_Load(object sender, EventArgs e)
    {
        NSOEF_EXT_Preview_Form_Button.Attributes.Add("onclick", "return ShowConfirm(" + NSOEF_EXT_Declaration_EnrolID_TB.ClientID + ");");
ASKER CERTIFIED SOLUTION
hosneylk

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
jsuanque

ASKER
Thanks Hosneylk,
It now works.