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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. printing & in html

printing & in html

Scheduled Pinned Locked Moved ASP.NET
helpjavascripthtml
2 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.
  • U Offline
    U Offline
    Utsav Verma
    wrote on last edited by
    #1

    Hi i have to add javascript validation in datagrid edititemtemplate. I code as follows textbox = e.Item.Cells(0).FindControl("txtBill").ClientID() textbox = "Form1." & textbox val = "return ( ForceEntry(document.getElementById('" & textbox & "'), 'Expenditure Bill No')" textbox = e.Item.Cells(0).FindControl("txtBillDetail").ClientID() 'textbox = "Form1." & textbox val = val & "&& ForceMoney(document.getElementById('" & textbox & " '), 'Expenditure Bill No')" val = val & "&& ForceEntry(document.getElementById('" & textbox & "'), 'Expenditure Bill Details')" textbox = e.Item.Cells(0).FindControl("txtAmt").ClientID() 'textbox = "Form1." & textbox val = val & "&& ForceEntry(document.getElementById('" & textbox & "'), 'Ammount')" val = val & "&& ForceMoney(document.getElementById('" & textbox & "'), 'Ammount')" val = val & ");" lnkb.Attributes.Add("onclick", val) but this code give me javascript error object required (javascript function used is ok) What problem i identified (may b wrong) in this code that character & is printed as & so if you have faced this problem or know the solution than plz tell me Thanks in advance Utsav Verma

    G 1 Reply Last reply
    0
    • U Utsav Verma

      Hi i have to add javascript validation in datagrid edititemtemplate. I code as follows textbox = e.Item.Cells(0).FindControl("txtBill").ClientID() textbox = "Form1." & textbox val = "return ( ForceEntry(document.getElementById('" & textbox & "'), 'Expenditure Bill No')" textbox = e.Item.Cells(0).FindControl("txtBillDetail").ClientID() 'textbox = "Form1." & textbox val = val & "&& ForceMoney(document.getElementById('" & textbox & " '), 'Expenditure Bill No')" val = val & "&& ForceEntry(document.getElementById('" & textbox & "'), 'Expenditure Bill Details')" textbox = e.Item.Cells(0).FindControl("txtAmt").ClientID() 'textbox = "Form1." & textbox val = val & "&& ForceEntry(document.getElementById('" & textbox & "'), 'Ammount')" val = val & "&& ForceMoney(document.getElementById('" & textbox & "'), 'Ammount')" val = val & ");" lnkb.Attributes.Add("onclick", val) but this code give me javascript error object required (javascript function used is ok) What problem i identified (may b wrong) in this code that character & is printed as & so if you have faced this problem or know the solution than plz tell me Thanks in advance Utsav Verma

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      I think that you mean that the character & is represented in the code as &. That is just as it should be. As the code is a value in an html tag, it has to be html encoded. So that is not the cause of the error. The cause of the error is that you are using the method getElementById with something that is not an id. You have put together the name of the form with the id of the field. That is perhaps a reference to the field, but it is not the id of the field. Skip this line: textbox = "Form1." & textbox --- b { font-weight: normal; }

      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