Checkbox checked state not changing in JQuery Mobile [closed] - jquery-mobile

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 10 years ago.
I'm creating an MVC4 project with JQuery Mobile UI.
This is my login form:
and this is my <form> in my html:
<form action="/Account/Login/" method="post">
<ul>
<li>
#Html.Label("User name:")
#Html.TextBox("userName")
</li>
<li>
#Html.Label("Password")
#Html.Password("password")
</li>
<li>
<input type="checkbox" name="rememberme" id="remember" />
<label for="remember">Remember me</label>
</li>
<li>
<input type="submit" value="Login" />
#{if (ViewBag.LoginFailed)
{
<br />
<b style="color: red;">Username and/or password was not correct. please try again.</b>
}
}
<br />
<br />
Not registered? Click here to create an account!
</li>
</ul>
</form>
My problem is: when I click on Remember me label or the checkbox, checkbox still remains unchecked...
How to solve this issue??
Edit: This is the complete output html from mvc, This is my style.css file, and this is the generated code in DOM.
(My project is changed since one month ago, so these outputs are a little different from the screenshot. But the checkbox still doesn't work...)

I tried it just now with jsfiddle and we know that Asp.Net MVC doesn't change HTML tags in output. But I also tried it in an MVC4 application and it worked. You can see the result here.
Your browser may has some problem with jquery mobile and if you are using chrome you can see the errors (if exist) using development tools of google chrome (to open it right click on page and click on inspect element).
update
your update give us an output file. I copied it in jsfiddle and it worked too. the problem isn't from HTML, JqueryMobile or another programming tools. I think it's because of your system.

Related

Placeholder text doesn't display in textarea

I'm just working on a form and having some issues with the placeholder not displaying inside the textarea.
If I do backspace twice it appears. Tried lots of different suggestions after trolling this site but haven't been able to resolve the issue yet. Happens in all browsers.
<div class="form-group">
<label>Description:</label>
<textarea placeholder= "Describe yourself" style="height:200px;
width:300px; font-size:12pt; align-top: "name= "profile_description"
class="form-control" required></textarea>
</div>
The above lines work well on their own despite the CSS align-top being incomplete.
The issue is with one of your custom class names. Please remove them one at a time to isolate the problem.
Update:
On troubleshooting further with #ljean we found that there were whitespaces in the textarea tag leading to this behaviour.
Update:
And so here is the code with the whitespaces which were causing the issue removed.
<div>
<b class="text-white" style="float:right">Already a member? <a
href="../login/index.html" class="text-white" style="text-
decoration:underline;">Sign in</b></a>
<br>
</div>

angular material's md-select can overflow its container

I created a codepen to illustrate the problem. Just select all of the options in the dropdown, and you'll see that the display of the selected items will overflow the container. For reference, here's the html that causes the issue:
<div><!-- this container needs some arbitrary max-width to be able to see the overflow -->
<div layout="row"><!-- making this a layout="column" instead of row will fix it -->
<div layout="column"><!-- putting max-width:100% here will fix it -->
<md-input-container>
<md-select ng-model="test" multiple>
<!-- md-options -->
</md-select>
</md-input-container>
</div>
</div>
</div>
I can't figure out why it would overflow, and so I'm not really clear on why the two fixes work. Can anyone explain why this isn't working as written, or propose a better way to avoid the problem?
Update: I found this is a known issue on the github site, but there is no good resolution there.
Update 2: I found the max-width solution doesn't help in IE11.

Behavior of ngModel in Angular2

I'm new to Angular2 and not able to explain the behavior observed where a change in an input form of one browser shows up immediately on a different one (even on a different device) showing the same page. What exactly is my "model" in this case?
And how is communication done from Client->Server->Clients, is this through an opened WebSocket? What server component is "forwarding" the changes?
"parameters" here is an array of {name, {value,unit}} retrieved through an http.get call.
<li *ngFor="let parameter of parameters">
<div>
<label>{{parameter[0]}}</label>
</div>
<input type="text" class="form-control"
[(ngModel)]='parameter[1][0]'>
</li>
Thanks

Multiple html pages using Intel App Framework

So I have an app that I am trying to strip out all of the JQuery Mobile and now use Intel's App Framework. I am having trouble figuring out how to integrate multiple html pages into the app so that I don't have to have all my code in a single file. I tried this:
$.ui.loadContent("page2.html");
but that doesn't seem to work. I get a 'loading content' spinner but nothing seems to happen.
How do I link pages together from different files?
Ok so I have figured it out. The documentation can sometimes be hard to search and there is no search box available on their website right now. But if you go to the quickstart and then then AFUI(on the left) and then panel properties they say:
data-defer="filename.html" - This will load content into the panel
from a remote page/url. This is useful for separating out content into
different files. af.ui.ready is not available until all files are
loaded asynchronously.
So in my index.html file I have something like this:
<div id="afui">
<nav>
<ul class="list">
<li>Post a Lunch</li>
<li>Personal Profile</li>
<li>Select University</li>
</ul>
</nav>
<!--Main View Pages-->
<div class="panel" title="Events" id="event-list_panel" data-defer="event-list.html" data-load="loadMainEventsList"> </div>
<div class="panel" title="Description" id="description_panel" data-defer="description.html" data-load="loadEventDetails"> </div>
<div class="panel" title="Select University" id="select-university_panel" data-defer="select-university.html"> </div>
</div> <!--id="afui"-->
and then I have the details of each page in seperate files. In my mind this does a literal copy/paste, and I haven't found any evidences yet that it isn't just a copy/paste.
Update:
in AF3 data-defer is now data-include

Posting a textarea with html content fails `No data received`

ok guys,
so here's another weird one:
i have the following form:
<form method="post" autocomplete="off">
<fieldset>
<legend>Edit article</legend>
<label>Description<textarea name="txtDescription"><%=article.Description %></textarea></label>
<label>Content<textarea name="txtContent"><%=article.Content %></textarea></label>
</fieldset>
<input type="submit" class="fr" value="save changes" />
</form>
there is nothing on the code behind page beside getting the article.
the page loads very fast, under 1 second, with that data in the textarea's.
when i try to submit this form, the page takes forever to load (actualy, it does not load at all, but fails after a few minuets with No data received.
the textarea content is just some html, not large (about 2-4kb each text area)
i have tried adding enctype="multipart/form-data", with no success, the same thing happens.
i have managed to narrow it down to the txtContent textarea, (i removed the description textarea)
and the page fails.
what makes this even worse is that if i open the page in the browser on my server,
it works with no problem, i can post, and it is all working as it should.
if i try to access the page from a remote machine, the post fails.
Anyone has any idea as to what happens here?
EDIT: just to make sure, i have created a simple HTML document with the following in it:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div id="header">
<nav>
<ul>
<li>Dashboard</li>
<li>Articles</li>
</ul>
</nav>
</div>
<div id="content">
<form method="post" action="test.html">
<fieldset>
<legend>Edit article</legend>
<label>Content<textarea name="txtcontent"></textarea></label>
</fieldset>
<input type="submit" class="fr" value="save changes" />
</form>
</div>
<div id="footer"></div>
</body>
</html>
this still fails.
EDIT: the test code shown here is the minimal code that is not working.
the actual form is larger, and if i remove the txtcontent textarea from the form,
the form submits with no problem, including the description textarea.
EDIT: Content-Length: 1555 / Content-Type: application/x-www-form-urlencoded
EDIT: i have uninstalled and reinstalled iis, and re-registered .NET
the problem is still there.
A few things to check....
What language are you using, e.g. ASP.NET WebForms, ASP.NET MVC and version?
I can see you are using
<form method="post" autocomplete="off">
In ASP.NET web forms, you would normally declare the form tag as
<form runat="server">
In ASP.NET MVC it would be similar to
#using(Html.BeginForm(......))
{
}
The other issue is you are posting HTML tags, by default ASP.NET will not allow this due to security reasons. Lookup XSS and be sure to understand the risks before disabling this feature.
Final note:
i have uninstalled IIS, Re-Installed IIS, Re-Registered .net framework,
and it seems to work fine now.
the reason for the original problem, unknown

Resources