Note that there are some explanatory texts on larger screens.

plurals
  1. POASP.NET input tags - cursor:default
    primarykey
    data
    text
    <p>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</p> <pre><code>disabled="disabled=\"disabled\"" </code></pre> <p>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</p> <pre><code>string disabled = (bool)ViewData["Finalized"] ? "disabled = \"disabled\" style=\"cursor:default\"" : null; </code></pre> <p>which renders the quotes within the tags as &quot;. 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?</p> <p>The resulting output of the above setup is</p> <pre><code>&lt;input maxlength="4" type="text" name="input1" value="1" disabled = &amp;quot;disabled&amp;quot; style=&amp;quot;cursor:default&amp;quot;/&gt; </code></pre> <p>Forgot to mention, inputs are defined on the page along the lines of this example:</p> <pre><code>&lt;input type="button" id="newtablebutton" class="pctbutton white" value="Add Table" onclick="showbox()" &lt;%: disabled %&gt; /&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload