Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6341129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:58:10+00:00 2026-05-24T19:58:10+00:00

I’ve got a page with a couple dozen (dynamically changeable amount) input fields (mostly

  • 0

I’ve got a page with a couple dozen (dynamically changeable amount) input fields (mostly text, a few buttons), and when the form is complete/submitted/finalized, it can no longer be edited but can still be viewed. What I did to accomplish this is to declare a string called disabled, and if the form has been finalized, it is set as

disabled="disabled=\"disabled\""

and otherwise is null. I then place it in evey input tag, so that they will be disabled. This works fine. However, the cursor still changes to a pointer on the buttons and a text cursor on the text boxes. How can I change that? I’m trying with

string disabled = (bool)ViewData["Finalized"] ? "disabled = \"disabled\" style=\"cursor:default\"" : null; 

which renders the quotes within the tags as ". The disable feature works fine, but the cursor is unaffacted.
I’ve tried rewriting it with single quotes within the string (same result), and with single quotes around the string and double quotes within it (error, too many characters in literal), but have had no success.
Is this something that can be done this way? Or am I going about it in the wrong way?

The resulting output of the above setup is

<input maxlength="4" type="text" name="input1" value="1"  disabled = &quot;disabled&quot; style=&quot;cursor:default&quot;/>

Forgot to mention, inputs are defined on the page along the lines of this example:

<input type="button" id="newtablebutton" class="pctbutton white" value="Add Table" onclick="showbox()" <%: disabled %> />
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T19:58:10+00:00Added an answer on May 24, 2026 at 7:58 pm

    So the output is exactly this?

    <input maxlength="4" type="text" name="input1" value="1"  disabled = &quot;disabled&quot; style=&quot;cursor:default&quot;/>
    

    You disabled string is getting html encoded when it’s set on the element. The reason is the way you’re setting it onto the element.

    Change this:

    <input type="button" id="newtablebutton" class="pctbutton white" value="Add Table" onclick="showbox()" <%: disabled %> />
    

    To this:

    <input type="button" id="newtablebutton" class="pctbutton white" value="Add Table" onclick="showbox()" <%= disabled %> />
    

    … and you should be good. The reason is that <%: disabled %> html encodes and <%= disabled %> does not.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a text area in my form which accepts all possible characters from
I have a reasonable size flat file database of text documents mostly saved in
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
I have a bunch of posts stored in text files formatted in yaml/textile (from
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm making a simple page using Google Maps API 3. My first. One marker

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.