Search Results

Search found 506 results on 21 pages for 'legend'.

Page 9/21 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • ASP.NET MVC returning ContentResult using Ajax form - how to preserve whitespace?

    - by Ben
    In my application users can enter commands that are executed on the server. The results are added to a session object. I then stuff the session object into ViewData and add it to a textarea. When done with a standard HTML form whitespace is preserved. However, when I swap this out for an ajax form (Ajax.BeginForm) and return the result as ContentResult, the whitespace is removed. Controller Action: [HttpPost] public ActionResult Execute(string submitButton, string command) { if (submitButton == "Clear") { this.CurrentConsole = string.Empty; } if (submitButton == "Execute" && !string.IsNullOrEmpty(command)) { var script = new PSScript() { Name = "Ad hoc script", CommandText = command }; this.CurrentConsole += _scriptService.ExecuteScript(script); } if (Request.IsAjaxRequest()) { return Content(this.CurrentConsole, "text/plain"); } return RedirectToAction("Index"); } View: <fieldset> <legend>Shell</legend> <%=Html.TextArea("console", ViewData["console"].ToString(), new {@class = "console", @readonly = "readonly"})%> <% using (Ajax.BeginForm("Execute", new AjaxOptions { UpdateTargetId = "console", OnBegin = "console_begin", OnComplete = "console_complete"})) { %> <input type="text" id="command" name="command" class="commandtext" /> <input type="submit" value="Execute" class="runbutton" name="submitButton" /> <input type="submit" value="Clear" class="runbutton" name="submitButton" /> <%} %> </fieldset> How can I ensure that whitespace is preserved? When I inspect the response in FireBug it looks like the whitespace is transmitted, so can only assume it has something to do with the way in which the javascript handles the response data.

    Read the article

  • Asp.Net MVC EditorTemplate Model is lost after Post

    - by Farrell
    I have a controller with two simple Methods: UserController Methods: [AcceptVerbs(HttpVerbs.Get)] public ActionResult Details(string id) { User user = UserRepo.UserByID(id); return View(user); } [AcceptVerbs(HttpVerbs.Post)] public ActionResult Details(User user) { return View(user); } Then there is one simple view for displaying the details: <% using (Html.BeginForm("Details", "User", FormMethod.Post)) {%> <fieldset> <legend>Userinfo</legend> <%= Html.EditorFor(m => m.Name, "LabelTextBoxValidation")%> <%= Html.EditorFor(m => m.Email, "LabelTextBoxValidation")%> <%= Html.EditorFor(m => m.Telephone, "LabelTextBoxValidation")%> </fieldset> <input type="submit" id="btnChange" value="Change" /> <% } %> As you can see, I use an editor template "LabelTextBoxValidation": <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<string>" %> <%= Html.Label("") %> <%= Html.TextBox(Model,Model)%> <%= Html.ValidationMessage("")%> Showing user information is no problem. The view renders perfectly user details. When I submit the form, the object user is lost. I debugged on the row "return View(User);" in the Post Details method, the user object is filled with nullable values. If I dont use the editor template, the user object is filled with correct data. So there has to be something wrong with the editor template, but can't figure out what it is. Suggestions?

    Read the article

  • Hidden Field losing its Value on postback

    - by Ratan
    I have a ascx page where I am using a hidden field to store the value of a the drop down box as it is generated using a google address finder. My problem is that when I try to store the value directly in the hidden field : hfDdlVerifyID.Value = ddlVerifySS.SelectedValue; in the event of a button click, the value is stored but on postback is lost again. Whereas, if i try to use Scriptmanager to do it, nothing is stored. getBuild.AppendLine("$get('" + hfDdlVerifyID.ClientID + "').value = $get('" + ddlVerifySS.ClientID + ").value;"); ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "storeHidden", getBuild.ToString(), true); // Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "storeHidden", getBuild.ToString(), true); string test = hfDdlVerifyID.Value.ToString(); The ascx page is : <asp:UpdatePanel ID = ddlUpdate runat="server"> <ContentTemplate> <asp:Panel ID="pVerify" runat="server"> <br /> <fieldset> <legend> <asp:Literal ID="lVerify" runat="server" /> </legend> <asp:CheckBox ID ="cbVerify" runat ="server" Text ="Use the value from the following list, (Uncheck to accept address as it is)." Checked ="true" /> <br /> <asp:DropDownList ID="ddlVerifySS" runat="server" onselectedindexchanged="ddlVerifySS_SelectIndexChange" /> <asp:HiddenField id ="hfDdlVerifyID" runat ="server" /> </fieldset> </asp:Panel> </ContentTemplate> </asp:UpdatePanel> <padrap:Button ID ="bVerify" runat ="server" CssClass ="btn" OnClick ="bVerify_Click" Text ="Verify Address" /> <asp:Button ID ="btnSubSite" runat ="server" text ="Save" CssCLass ="btn" OnClick ="save_btn_Click_subSite" onLoad="ddlVerify_Load" />

    Read the article

  • zend_form display group inside foreach

    - by Mike
    I want to create a display group generated from foreach() clause output. I can't seem to get the syntax correct. Here's the business logic: for each category row find the associated fees output the category description as a label and the fees as radio buttons then create a display group with the fees as the group elements and the category description as the legend. I then have a style sheet format the elements on the page. and here's the code: foreach ($categoryData as $categoryRow) { $fees[$i] = new Zend_Form_Element_Radio("fees[$i]"); $fees[$i]->setDescription(strval($categoryRow['description'])); foreach ($feeData as $feeRow) { if ($feeRow['categories_idCategory'] == $categoryRow['idCategory']){ $fees[$i] ->addMultiOption($feeRow['idFees'] . '-' . $feeRow['categories_idCategory'], $feeRow['amount'] . '-' . $feeRow['name']); } } $fees[$i]->setRequired(TRUE); $this->addElements(array($fees[$i])); $this->addDisplayGroup($feeRow['name'], 'feeGroup',array('legend' => strval($feeRow['description']))); $i++; } I tried placing the addDisplayGroup() code within the foreach(), but I get the error: Message: No valid elements specified for display group So, my guess is that I'm making some kind of novice mistake that you experts will spot right away. I appreciate your time and attention to this matter.

    Read the article

  • How to secure Add child record functionality in MVC on Parent's view?

    - by RSolberg
    I'm trying to avoid some potential security issues as I expose some a new set of functionality into the real world. This is basically functionality that will allow for a new comment to be added via a partialview on the "Parent" page. My comment needs to know a couple of things, first what record is the comment for and secondly who is making the comment. I really don't like using a hidden field to store the ID for the Parent record in the add comment form as that can be easily changed with some DOM mods. How should I handle this? PARENT <% Html.RenderPartial("AddComment", Model.Comments); %> CHILD <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<CommentsViewModel>" %> <% using (Html.BeginForm("AddComment", "Requests")) {%> <fieldset> <legend>New Comment</legend> <%= Html.HiddenFor(p => p.RequestID) %> <%= Html.TextBoxFor(p => p.Text) %> &nbsp; <input type="submit" value="Add" /> </fieldset> <% } %> CONTROLLER [AcceptVerbs(HttpVerbs.Post)] public void AddComment(CommentsViewModel commentsModel) { var user = GetCurrentUser(); commentsModel.CreatedByID = user.UserID; RequestsService.AddComment(commentsModel); }

    Read the article

  • Blueprint CSS and Separation of Presentation and Content When Designing Forms

    - by Merritt
    Is it possible to use Blueprint CSS and maintain a a respectable level of separation between presentation and content? I like how easy the framework is to use when designing forms, but am worried that the manner in which I use the css classes for columnizing elements is a bad practice. For instance, say I have a 3 field form designed using blueprint: <div class="container"> <form action="" method="post" class="inline"> <fieldset> <legend>Example</legend> <div class="span-3"> <label for="a">Label A:</label> <input type="text" class="text" id="a" name="a" > </div> <div class="span-2"> <label for="b">Label B:</label> <input type="text" class="text" id="b" name="b" > </div> <div class="span-3"> <label for="o">Label O:</label> <input type="checkbox" id="o" name="o" value="true" checked="checked" class="checkbox">checkbox one </div> <div class="span-2 last"> <input type="submit" value="submit" class="button"> </div> </fieldset> </form> </div> Is using a class attribute with names like "span-2", "inline", and "last" a bad practice? Or am I missing the point?

    Read the article

  • Right-Align and Vertical Align label with checkbox/radio button CSS

    - by Jon
    Hi Everyone, I'm very close and have this working in Safari, Firefox and IE8, however IE7 the labels and radio buttons do not align vertically. My HTML is: <div id="master-container"> <fieldset id="test"> <legend>This is a test of my CSS</legend> <ul class="inputlist"> <li> <label for="test1">Test 1</label> <input name="test1" id="test1" type="checkbox" disabled="disabled"/> </li> <li> <label for="test2">Test 2</label> <input name="test2" id="test2" type="checkbox" disabled="disabled"/> </li> </ul> </fieldset> </div> My CSS Is: html{font-family:Arial,Helvetica,sans-serif;} #master-container{width:615px;font-size:12px;} ul.inputlist{list-style-type:none;} ul.inputlist li{width:100%;margin-bottom:5px;} ul.inputlist li label{width:30px; text-align:right; margin-right:7px;float:left;} Any suggestions? Thanks! EDIT: Based on the suggestion to check the rest of my html and css. I updated the code above and now it accurately demonstrates the problem. If I take font-size out of #master-container it lines up but then it is not the proper font-size. I tried to add a font-size to ul.inputlist li input but that didn't help. Any suggestions? Thanks for your help everyone!

    Read the article

  • Why is PHP not allowing comparison?

    - by dcp3450
    I'm using PHP to read if an entry in my table on the database is set to "yes" or "no" and auto check the radio button that corresponds: <?php include 'file.php'; $query = "SELECT * FROM TABLE"; $runquery = odbc_exec($connect,$query); $status= odbc_result($runquery,"status"); odbc_close($file); ?> <form> <div class="formContainer"> <fieldset> <legend>Campus Alert<span class="tooltip">Turn campus alert on and off.</span></legend> <?php echo $status; ?> Yes <input type="radio" name="alertStatus" id="alertStatus" value="yes" <?php if($status== "yes") echo "checked";?>> No <input type="radio" name="alertStatus" id="alertStatus" value="no" <?php if($status== "no") echo "checked";?>> </fieldset> </div> the is for debugging so I can make sure what the database says and the form's reaction is correct. It prints "yes" (no quotes). However, the if statement will not respond. Any idea why it's doing this?

    Read the article

  • MVC View Model Intellisense / Compile error

    - by Marty Trenouth
    I have one Library with my ORM and am working with a MVC Application. I have a problem where the pages won't compile because the Views can't see the Model's properties (which are inherited from lower level base classes). They system throws a compile error saying that 'object' does not contain a definition for 'ID' and no extension method 'ID' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?) implying that the View is not seeing the model. In the Controller I have full access to the Model and have check the Inherits from portion of the view to validate the correct type is being passed. Controller: return View(new TeraViral_Blog()); View: <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<com.models.TeraViral_Blog>" %> <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> Index2 </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <h2>Index2</h2> <fieldset> <legend>Fields</legend> <p> ID: <%= Html.Encode(Model.ID) %> </p> </fieldset> </asp:Content>

    Read the article

  • RedirectToAction and validate MVC 2

    - by Dan
    Hi, my problem is the View where the user typed, the validation. I have to take RedirectToAction on the site because on the site upload a file. Thats my code. My model class public class Person { [Required(ErrorMessage= "Please enter name")] public string name { get; set; } } My View <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MvcWebRole1.Models.Person>" %> Name <h2>Information Data</h2> <%= Html.ValidationSummary() %> <%using (Html.BeginForm ("upload","Home", FormMethod.Post, new{ enctype ="multipart/form-data" })) {%> <fieldset> <legend>Fields</legend> <p> <label for="name">name:</label> <%= Html.TextBox("name") %> <%= Html.ValidationMessage("name", "*") %> </p> </fieldset> <% } %> and the Controller [AcceptVerbs(HttpVerbs.Post)] public ActionResult upload(FormCollection form) { Person lastname = new Person(); lastname.name = form["name"]; return RedirectToAction("Index"); } Thx for answer my question In advance

    Read the article

  • jquery - radio button not checked on page load, but checked on same function call later

    - by Bill Zimmerman
    Hi, I'm having a strange problem with jquery. When my page loads, I dynamically create some simple radio buttons in a special i've created. However, the default radio button is not checked. It is checked however when the change() event is triggered later, but is never checked the first time. Can someone help? I am certain that the change() event is triggered on the page load, because the rest of the HTML is added dynamically and I can see it. The basic idea is when the page loads, I bind an event handler, and then immediately call it to make sure that the default options are loaded. $(document).ready(function() { $(".options select[name=App]").change(onAppChange); //trigger the change function in the dropdown to populate default options $(".options select[name=App]").change() } Here is the simple onAppChange() function: function onAppChange() { var val = $(this).val(); var app_options = $(this).closest(".options").find(".app_options"); //clear the app_options app_options.empty(); var newOptions = ''; switch(val) { case 'testapp': newOptions='\ <fieldset>\ <legend>TestApp</legend>\ Option 1:\ <label>\ <input type="radio" name="option1" value="value1" checked>\ Value1\ </label>\ \ <label>\ <input type="radio" name="option1" value="value2">\ value2\ </label>\ \ </fieldset>'; break; case 'todo': //for testing newOptions='FOO'; break; } app_options.append(newOptions); } Yes, I am aware that I could use javascript to automatically select a radio button again, but I asked this question because I wanted to understand why this is happening. When using and , there doesn't seem to be any problem. Only with radio buttons. Why does the behavior differ when the same change() event is triggered? What is going on behind the scenes?

    Read the article

  • jQuery: is there a way to make a recursive child selector?

    - by gsquare567
    instead of checking only the immediate children of an element, i would like to recursively check all children of the element. specifically, something like $("#survey11Form>input[type=text]:visible").val(); with the html: <form id="survey11Form" name="survey11Form" action="#" method="post"> <div id="survey11Div"> <fieldset> <legend>TEST'TEST"TEST</legend> <div class="label"> <label test="" title="TEST'TEST" for="answer15"> TEST'TEST"TEST </label></div> <div class="fieldWrapper text required"> <div style="width: 146px;" class="cellValue"> <input type="text" title="TEST'TEST" value="" id="survey11answer15" name="survey11answer15"> should give me the value of that input. the jquery i've come up with does not. any ideas as to what would work in this situation (and all recursive situations)? thanks!

    Read the article

  • problem drawing gRaphaeljs pie chart

    - by Aswad
    Hi, I was trying to draw the raphaeljs piechart. I used the same example as shown on "http://g.raphaeljs.com/piechart2.html". It renders me the text but the pie charts goes missing.Can someone please help? please find the code below. g·Raphaël Dynamic Pie Chart Demo window.onload = function () { var r = Raphael("holder"); r.g.txtattr.font = "12px 'Fontin Sans', Fontin-Sans, sans-serif"; r.g.text(320, 100, "Interactive Pie Chart Demo").attr({"font-size": 20}); var pie = r.g.piechart(320, 240, 100, [55, 20, 13, 32, 5, 1, 2, 10], {legend: ["%%.%% – Enterprise Users", "IE Users"], legendpos: "west", href: ["http://raphaeljs.com", "http://g.raphaeljs.com"]}); pie.hover(function () { this.sector.stop(); this.sector.scale(1.1, 1.1, this.cx, this.cy); if (this.label) { this.label[0].stop(); this.label[0].scale(1.5); this.label[1].attr({"font-weight": 800}); } }, function () { this.sector.animate({scale: [1, 1, this.cx, this.cy]}, 500, "bounce"); if (this.label) { this.label[0].animate({scale: 1}, 500, "bounce"); this.label[1].attr({"font-weight": 400}); } }); }; </script> </head> <body class="raphael" id="g.raphael.dmitry.baranovskiy.com"> <div id="holder"></div> <p> Pie chart with legend, hyperlinks on two first sectors and hover effect. </p> <p> Demo of <a href="http://g.raphaeljs.com/">g·Raphaël</a> JavaScript library. </p> </body>

    Read the article

  • Determining which form input failed validation?

    - by Alastair Pitts
    I am designing a creation wizard in ASP.NET MVC 1 and instead of posting back each step, I'm using javascript to toggle the display of the different steps divs. This is a quick sample of the code, just to explain. <% using (Html.BeginForm()) {%> <fieldset> <legend>Fields</legend> <div id="wizardStep1"> <% Html.RenderPartial("CreateStep1", Model); %> </div> <div id="wizardStep2"> <% Html.RenderPartial("CreateStep2", Model); %> </div> <div id="wizardStep3"> <% Html.RenderPartial("CreateStep3", Model); %> </div> </fieldset> <% } %> I have javascript that just toggles the visibility of the divs, with each partial view containing a different section of the input form (which is pretty large by itself) My question is, if the form fails validation and I reload the page with the validation errors, is there a way for me to determine which div contains the error? Either in javascript or other? Failing that, is there a good client-side validation library for MVC 1? Ideally I'd love to move to MVC2 and the client side validation built into that, but I am required to use MVC1

    Read the article

  • Problems with html forms.

    - by Michael
    My form views fine in IE7 and IE8 but FireFox does not display the form correctly: The problem is it does not display the form inside my "mainContent1" Note my code below: <div id="mainContent1"> <form action="forms.php" target="_self"> <fieldset> <legend>Postal Address</legend> <label for="street">Street address:</label> <input id="street" name="street" type="text" /> <label for=" suburb">County</label> <input id="county" name="county" type="text" /> <label for="state">State</label> <input id="state" name="state" type="text" /> <label for="zip">Zip Code</label> <input id="zip" name="zip" type="text" /> </fieldset> </form> </div>

    Read the article

  • If statement with dataitems in markup

    - by Eric
    I am trying to write an if statement to decide whether or not to display a field. I'm using a listview. <telerik:RadListView ID="RadListView4" runat="server" ItemPlaceholderID="WitnessPlaceHolder" DataSourceID="SqlDataSource5"> <LayoutTemplate> <asp:PlaceHolder ID="WitnessPlaceHolder" runat="server" /> </LayoutTemplate> <ItemTemplate> <center> <fieldset style="float: left; width: 280px;"> <legend> <%# Eval("title").ToString()%> </legend> <table> <tr> <td align="center"> <%if (DataBinder.Eval(Container.DataItem,"field").Equals("C")) Response.Write(Eval("field"));%> </td> How can I write the above if statement in the markup?? What i have doesn't work.

    Read the article

  • PHP contact form font color is stuck to black

    - by Richard Hayward
    No matter what i try strangely enough my form and thank you page both php files one with embed font coloring and one with an external style sheet refuse to change font color from black. thank you php file: http://www.richiesportfolio.com/contact/thank-you.php contact form php file: http://www.richiesportfolio.com/contact/contactform.php Everything else works purfectly but changing the contact forms font color contactform.php ` <?PHP require_once("./include/fgcontactform.php"); $formproc = new FGContactForm(); if(isset($_POST['submitted'])) { if($formproc->ProcessForm()) { $formproc->RedirectToURL("thank-you.php"); } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US"> <head> <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/> <title>Contact us</title> <link rel="stylesheet" type="text/css" href="http://www.richiesportfolio.com/contact/contact.css" /> <script type='text/javascript' src='scripts/gen_validatorv31.js'></script> </head> <body> <!-- Form Code Start --> <form id='contactus' action='<?php echo $formproc->GetSelfScript(); ?>' method='post' accept-charset='UTF-8'> <fieldset > <legend>Contact Me</legend> <input type='hidden' name='submitted' id='submitted' value='1'/> <input type='hidden' name='<?php echo $formproc->GetFormIDInputName(); ?>' value='<?php echo $formproc->GetFormIDInputValue(); ?>'/> <input type='text' class='spmhidip' name='<?php echo $formproc->GetSpamTrapInputName(); ?>' /> <div class='short_explanation'>* required fields</div> <div><span class='error'><?php echo $formproc->GetErrorMessage(); ?></span></div> <div class='container'> <label for='name' >Your Full Name*: </label><br/> <input type='text' name='name' id='name' value='<?php echo $formproc->SafeDisplay('name') ?>' maxlength="50" /><br/> <span id='contactus_name_errorloc' class='error'></span> </div> <div class='container'> <label for='email' >Email Address*:</label><br/> <input type='text' name='email' id='email' value='<?php echo $formproc->SafeDisplay('email') ?>' maxlength="50" /><br/> <span id='contactus_email_errorloc' class='error'></span> </div> <div class='container'> <label for='message' >Message:</label><br/> <span id='contactus_message_errorloc' class='error'></span> <textarea rows="10" cols="50" name='message' id='message'><?php echo $formproc->SafeDisplay('message') ?></textarea> </div> <div class='container'> <input type='submit' name='Submit' value='Submit' /> </div> </fieldset> </form> <!-- client-side Form Validations: Uses the excellent form validation script from JavaScript-coder.com--> <script type='text/javascript'> // <![CDATA[ var frmvalidator = new Validator("contactus"); frmvalidator.EnableOnPageErrorDisplay(); frmvalidator.EnableMsgsTogether(); frmvalidator.addValidation("name","req","Please provide your name"); frmvalidator.addValidation("email","req","Please provide your email address"); frmvalidator.addValidation("email","email","Please provide a valid email address"); frmvalidator.addValidation("message","maxlen=2048","The message is too long!(more than 2KB!)"); // ]]> </script> </body> </html>` contact.css body,table,tr,td,a,p,h1,h2,h3,h4,h5,input,h3 a,h4 a,h5 ul, li, ul, a { color:#FFF; } #contactus fieldset { width:320px; padding:20px; border:20px; -moz-border-radius: 10px; -webkit-border-radius: 10px; -khtml-border-radius: 10px; border-radius: 10px; } #contactus legend, h2 { font-family : Arial, sans-serif; font-size:1.3em; font-weight:bold; color:#FFF; } #contactus label { font-family : Arial, sans-serif; font-size:0.8em; font-weight: bold; color:#FFF; } #contactus input[type="text"],textarea { font-family : Arial, Verdana, sans-serif; font-size: 0.8em; line-height:140%; color : #000; padding : 3px; border : 1px solid; #999; -moz-border-radius: 5px; -webkit-border-radius: 5px; -khtml-border-radius: 5px; border-radius: 5px; } #contactus input[type="text"] { height:18px; width:220px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; } #contactus #scaptcha { width:60px; height:18px; } #contactus input[type="submit"] { width:100px; height:30px; padding-left:0px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; } #contactus textarea { height:120px; width:310px; -webkit-border-radius:8px; -moz-border-radius: 8px; border-radius: 8px; } #contactus input[type="text"]:focus,textarea:focus { color : #009; border : 1px solid #990000; background-color : #ffff99; font-weight:bold; } #contactus .container { margin-top:8px; margin-bottom:10px; color:#FFF; } #contactus .error { font-family: Verdana, Arial, sans-serif; font-size: 0.7em; color: #900; background-color : #111; } #contactus fieldset#antispam { padding:2px; border-top:1px solid #EEE; border-left:0; border-right:0; border-bottom:0; width:350px; } #contactus fieldset#antispam legend { font-family : Arial, sans-serif; font-size: 0.8em; font-weight:bold; color:#FFF; } #contactus .short_explanation { font-family : Arial, sans-serif; font-size: 0.6em; color:#FFF; } /* spam_trap: This input is hidden. This is here to trick the spam bots*/ #contactus .spmhidip { display:none; width:10px; height:3px; } #fg_crdiv { font-family : Arial, sans-serif; font-size: 0.3em; opacity: .2; -moz-opacity: .2; filter: alpha(opacity=20); } #fg_crdiv p { display:none; }

    Read the article

  • Modelbinding Failing VS2010 asp.net mvc2

    - by Rob Ellis
    The contactAddModel.Search always comes through as null - any ideas? View declaration <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<rs30UserWeb.Models.StatusIndexModel>" %> ViewModels public class StatusIndexModel { public ContactAddModel contactAddModel; public StatusMessageModel statusMessageModel; } public class ContactAddModel { [Required(ErrorMessage="Contact search string")] [DisplayName("Contact Search")] public string Search { get; set; } } View content <% using (Html.BeginForm("AddContact", "Status")) { %> <div> <fieldset> <legend>Add a new Contact</legend> <div class="editor-label"> <%= Html.LabelFor(m => m.contactAddModel.Search) %> </div> <div class="editor-field"> <%= Html.TextBoxFor(m => m.contactAddModel.Search)%> <%= Html.ValidationMessageFor(m => m.contactAddModel.Search)%> </div> <p> <input type="submit" value="Add Contact" /> </p> </fieldset> </div> <% } %> Controller [HttpPost] public ActionResult AddContact(Models.ContactAddModel model) { if (u != null) { } else { ModelState.AddModelError("contactAddModel.Search", "User not found"); } return View("Index"); }

    Read the article

  • CakePHP passing parameters to action

    - by iancocco
    Hi im kinda new in cakephp and having a lot of trouble adjusting.. Here's my biggest problem .. Im trying to pass a parameter to an action, it does load, but when my script goes from the controller to the view, and goes back to the controller again, its gone. CONTROLLER CODE function add($mac = 0) { if(isset($this->params['form']['medico'])) { $temp= $this->Person->find('first', array('conditions' => array('smartphones_MAC' => $mac))); $id= $temp['Person']['id']; $this->Union->set('events_id', $id+1); $this->Union->set('people_id', $id); $this->Union->save(); } VIEW CODE (This is a menu, i only have one button right now) <fieldset> <legend>SELECCIONE SU ALERTA</legend> <?php echo $form->create('Event'); echo $form->submit('EMERGENCIA MEDICA',array('name'=>'medico')); echo $form->end(); ?> </fieldset>

    Read the article

  • QUnit Unit Testing: Test Mouse Click

    - by Ngu Soon Hui
    I have the following HTML code: <div id="main"> <form Id="search-form" action="/ViewRecord/AllRecord" method="post"> <div> <fieldset> <legend>Search</legend> <p> <label for="username">Staff name</label> <input id="username" name="username" type="text" value="" /> <label for="softype"> software type</label> <input type="submit" value="Search" /> </p> </fieldset> </div> </form> </div> And the following Javascript code ( with JQuery as the library): $(function() { $("#username").click(function() { $.getJSON("ViewRecord/GetSoftwareChoice", {}, function(data) { // use data to manipulate other controls }); }); }); Now, how to test $("#username").click so that for a given input, it calls the correct url ( in this case, its ViewRecord/GetSoftwareChoice) And, the output is expected (in this case, function(data)) behaves correctly? Any idea how to do this with QUnit? Edit: I read the QUnit examples, but they seem to be dealing with a simple scenario with no AJAX interaction. And although there are ASP.NET MVC examples, but I think they are really testing the output of the server to an AJAX call, i.e., it's still testing the server response, not the AJAX response. What I want is how to test the client side response.

    Read the article

  • How can I set the size of the gap between inline elements in CSS?

    - by Val M
    I am creating an MVC 1.0 form to use in multiple views. I have some elements that need to be shown on the same line, and I have done this by setting the display to "display: inline" for the style. I have also added the margin-left setting to the CSS in order to force the gap between the inline elements but this doesn't appear to be being set. My CSS has: fieldset label.inline { display: inline; margin-left: 2em; } The view code is: <fieldset> <legend>Details</legend> <p> <label for="StartTime">Start Time:</label> <%= Html.TextBox("StartTime", Model.StartTime.ToShortTimeString())%> <label for="NextDay" class="inline">Next Day?</label> <%= Html.CheckBox("NextDay") %> <%= Html.ValidationMessage("StartTime", "*")%> </p> </fieldset> Setting the size in the "margin-left" style has no impact on the space between the StartTime control and the NextDay label. How can I create this gap between the elements?

    Read the article

  • How do I label a group of radio boxes for WCAG / 508 Compliance? Is ASP.NET doing it wrong?

    - by Mark Brittingham
    I am trying to bring an existing web site into greater conformance with WCAG 2.0 Guidelines and am a bit confused over the output emitted by Microsoft (ASP.NET 4.0 although it was the same in 3.5). Suppose you have a question like: "How would you rate your health?" and a set of 5 answers created using an ASP.NET RadioButtonList. I place the question in an asp:Label with an "AssociatedControlID" that matches the ID of the RadioButtonList (e.g. "SelfRatingBox"). Seems pretty easy... Only the output that is generated has an html "label" with a "For" that is equal to the ID of a table that wraps up the RadioButtons. I assumed that this would work with page readers but our 508 compliance guy is saying that the reader isn't associating the label with the radio controls. The WCAG guidelines indicate that you have to use a fieldset around the entire group and a legend to capture the associated text (the question). So what gives? It would be ideal if MS could take my label and the radiobuttonlist and generate the appropriate fieldset and legend tags but it seems pretty clear that to achieve WCAG compliance, I'll have to roll my own. Is this correct or am I missing something?

    Read the article

  • PHP Treat String as Variable

    - by Ygam
    Hi guys. I have a piece of code here that does not work despite me using a $$ on it to treat the string as a variable: <? foreach (KOHANA::config('list.amenities_forms') as $k => $v) : ?> <div class="form"> <fieldset> <legend><?php echo $v ?></legend> <input type="checkbox" name="<?=$k?>flag" id="<?=$k?>flag"/> <label class="inline"><?=$v?></label> <label>Description</label> <textarea cols="50" rows="5" name="<?=$k?>[]"><?= empty($$k[0]) ? '' : $$k[0]?></textarea> <label>Size</label> <input type="text" name="<?=$k?>[]" value="<?= empty($$k[1]) ? '' : $$k[1]?>"/> <label>Capacity</label> <input type="text" name="<?=$k?>[]" value="<?= empty($$k[2]) ? '' : $$k[2]?>"/> </fieldset> </div> <? endforeach?> the function Kohana::config returns this array: 'amenities_forms' => array( 'meeting_space' => 'Meeting Space', 'breakfast_room' => 'Breakfast Room', 'living_quarters' => 'Living Quarters', 'restaurant' => 'Restaurant', 'bar' => 'Bar' ) what could I be doing wrong?

    Read the article

  • ASP.net MVC 2 EditorFor Dictionary Bind

    - by user307540
    Hi! I try this, but don't work. bemutatkozas@Modify = null all the time. public class Iroda { public Dictionary<int,string> bemutatkozas { get; set; } } public ActionResult Index() { var dct = new Dictionary<int, string>(); dct.Add(1, "magyar"); dct.Add(2, "angol"); dct.Add(3, "olasz"); return View(new Iroda { bemutatkozas = dct }); } [HttpPost] public ActionResult Modify(Dictionary<int,string> bemutatkozas) { return View(); } <% using (Html.BeginForm("Modify","Iroda")) {%> <%= Html.ValidationSummary(true) %> <fieldset> <legend>Fields</legend> <%= Html.EditorFor(o=>o.bemutatkozas,"MultiLanguageEditor") %> <p> <input type="submit" value="Save" /> </p> </fieldset> <% } %> <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Dictionary<int, string>>" %> <% int i = 0; %> <% foreach (var s in Model) { %> <%= Html.Hidden(Html.ViewContext.ViewData.TemplateInfo.HtmlFieldPrefix+"["+i+"].key", s.Key) %> <%= Html.TextBox(Html.ViewContext.ViewData.TemplateInfo.HtmlFieldPrefix+"["+i+"].value",s.Value) %> <% i++; %> <% }%> Whats the solution? Thx!

    Read the article

  • jqueryvalidation no space customization

    - by Ken
    i have a form where the user can update his name and last name. i use jquery validation to validate the form. how can i validate if the user put spaces? here's what i have: <script> $(document).ready(function(){ $('#submit').click(function() { var valid = $("#myform").valid(); if(!valid) { return false; } $.ajax({ type: "POST", url: 'save', data: $('#myform').serialize(), dataType: 'json', cache: false, success: function(result) { // redirect to another page } }); }); }); </script> </head> <body> <form id="myform" method="post" action=""> <fieldset> <legend>update name</legend> <p> <label for="fname">Name</label> <em>*</em><input id="fname" name="fname" size="25" class="required" minlength="2" /> </p> <p> <label for="lname">Last Name</label> <em>*</em><input id="lname" name="lname" size="25" class="required" minlength="2" /> </p> <p> <input id="submit" type="submit" value="Submit"/> </p> </fieldset> </form> thanks

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >