Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. javascript wtih LinkButton Confirmation box Formatting Text

javascript wtih LinkButton Confirmation box Formatting Text

Scheduled Pinned Locked Moved .NET (Core and Framework)
questionjavascript
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    Zap Man
    wrote on last edited by
    #1

    I have a gridview that displays a delete LinkButton. I also have a javascript confim box display before any action is taken. This works just find. What I want to do is insert a carrage return in the confim box. I thought that I could use "\n" but for some reason when I try this the confimation box does not display and the row is deleted. below is the function I have that is displaying the box.

    protected void SetDeleteButton(Object sender, EventArgs e) {
    LinkButton btn= (LinkButton)sender;

        btn.Attributes.Add("onclick", "return confirm(\\"Removing this Category will remove all Sub-Categories and Products tied to this Category. Are you sure you want to proceed? \\");");
    }
    

    I get what I want from this except the format of the text is not neat. I would like to center the text if possible. and I want a new line where its asking the question "Are you sure you want to proceed?"

    T 1 Reply Last reply
    0
    • Z Zap Man

      I have a gridview that displays a delete LinkButton. I also have a javascript confim box display before any action is taken. This works just find. What I want to do is insert a carrage return in the confim box. I thought that I could use "\n" but for some reason when I try this the confimation box does not display and the row is deleted. below is the function I have that is displaying the box.

      protected void SetDeleteButton(Object sender, EventArgs e) {
      LinkButton btn= (LinkButton)sender;

          btn.Attributes.Add("onclick", "return confirm(\\"Removing this Category will remove all Sub-Categories and Products tied to this Category. Are you sure you want to proceed? \\");");
      }
      

      I get what I want from this except the format of the text is not neat. I would like to center the text if possible. and I want a new line where its asking the question "Are you sure you want to proceed?"

      T Offline
      T Offline
      thatraja
      wrote on last edited by
      #2

      use

      \\n

      for the new line.

      Z 1 Reply Last reply
      0
      • T thatraja

        use

        \\n

        for the new line.

        Z Offline
        Z Offline
        Zap Man
        wrote on last edited by
        #3

        lol I diffently should have seen that. Guess I was just having a brain fart. Thanks

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups