Java script for confirm
-
hi all, I have a Dropdown box(Active/Inactive) in Asp updateform.If the user selects Inactive and updates the form,then SP gives an output message that Inactive is selected. Here i need to keep an confirm box using java script.This should be called only when Inactive is selected. So i wrote code like this
//.cs protected void FormView1_ItemUpdating(object sender, FormViewUpdateEventArgs e) { if (myCommand_update.Parameters["@out_Message"].Value != DBNull.Value) { Status_Msg.Text = Convert.ToString(myCommand_update.Parameters["@out_Message"].Value); update_btn.Attributes.Add("onclick","return confirm_update();") } } //java script function confirm_update() { if (confirm("Would you like to Inactive the same?")==true) return true; else return false; }
but it is not working. If active is selected there will be no ouput meaasge. Plz help me to find the solution Thanks in advance,cheers sangeet
-
hi all, I have a Dropdown box(Active/Inactive) in Asp updateform.If the user selects Inactive and updates the form,then SP gives an output message that Inactive is selected. Here i need to keep an confirm box using java script.This should be called only when Inactive is selected. So i wrote code like this
//.cs protected void FormView1_ItemUpdating(object sender, FormViewUpdateEventArgs e) { if (myCommand_update.Parameters["@out_Message"].Value != DBNull.Value) { Status_Msg.Text = Convert.ToString(myCommand_update.Parameters["@out_Message"].Value); update_btn.Attributes.Add("onclick","return confirm_update();") } } //java script function confirm_update() { if (confirm("Would you like to Inactive the same?")==true) return true; else return false; }
but it is not working. If active is selected there will be no ouput meaasge. Plz help me to find the solution Thanks in advance,cheers sangeet
try running your code like this first, function confirm_update() { alert('hello'); } in this way you can be sure that your function is being called or not. if you see pop up saying 'hello' then there would be something wrong with your code which this, function confirm_update() { if (confirm("Would you like to Inactive the same?")==true) return true; else return false; }