Search Results

Search found 2395 results on 96 pages for 'nathan strong'.

Page 7/96 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Ajax, Multiple Attachments and Paperclip question.

    - by dustmoo
    Alright everyone this is a bit of a complicated setup so if I need to clarify the question just let me know. I have a model: class IconSet < ActiveRecord::Base has_many :icon_graphics end This Model has many icongraphics: class IconGraphic < ActiveRecord::Base belongs_to :icon_set has_attached_file :icon has_attached_file :flagged end As you can see, IconGraphic has two attached files, basically two different versions of the icon that I want to load. Now, this setup is working okay if I edit the icongraphic's individually, however, for ease of use, I have all the icon graphics editable under the IconSet. When you edit the icon set the form loads a partial for the icongraphics: <% form_for @icon_set, :html => {:class => 'nice', :multipart => true} do |f| %> <fieldset> <%= f.error_messages %> <p> <%= f.label :name %> <%= f.text_field :name, :class => "text_input" %> </p> <!-- Loaded Partial for icongraphics --> <div id="icon_graphics"> <%= render :partial => 'icon_graphic', :collection => @icon_set.icon_graphics %> </div> <div class="add_link"> <%= link_to_function "Add an Icon" do |page| page.insert_html :bottom, :icon_graphics, :partial => 'icon_graphic', :object => IconGraphic.new end %> </div> <p><%= f.submit "Submit" %></p> </fieldset> <% end %> This is based largely off of Ryan's Complex Forms Railscast. The partial loads the file_field forms: <div class="icon_graphic"> <% fields_for "icon_set[icon_graphic_attributes][]", icon_graphic do |icon_form|-%> <%- if icon_graphic.new_record? -%> <strong>Upload Icon: </strong><%= icon_form.file_field :icon, :index => nil %><br/> <strong>Upload Flagged Icon: </strong><%= icon_form.file_field :flagged, :index => nil %> <%= link_to_function image_tag('remove_16.png'), "this.up('.icon_graphic').remove()"%><br/> <% else -%> <%= image_tag icon_graphic.icon.url %><br/> <strong>Replace <%= icon_graphic.icon_file_name %>: </strong><%= icon_form.file_field :icon, :index => nil %><br /> <% if icon_graphic.flagged_file_name.blank? -%> <strong>Upload Flagged Icon: </strong><%= icon_form.file_field :flagged, :index => nil %> <% else -%> <strong>Replace <%= icon_graphic.flagged_file_name %>: </strong><%= icon_form.file_field :flagged, :index => nil %> <%= icon_form.hidden_field :flagged, :index => nil %> <% end -%> <%= link_to_function image_tag('remove_16.png'), "mark_for_destroy(this, '.icon_graphic')"%><br/> <%= icon_form.hidden_field :id, :index => nil %> <%= icon_form.hidden_field :icon, :index => nil %> <%= icon_form.hidden_field :should_destroy, :index => nil, :class => 'should_destroy' %> <br/><br/> <%- end -%> <% end -%> </div> Now, this is looking fine when I add new icons, and fill both fields. However, if I edit the IconSet after the fact, and perhaps try to replace the icon with a new one, or if I uploaded only one of the set and try to add the second attachment, paperclip doesn't put the attachments with the right IconGraphic Model. It seems that even though I have the IconGraphic ID in each partial, <%= icon_form.hidden_field :id, :index => nil %> it seems that paperclip either creates a new IconGraphic or attaches it to the wrong one. This all happens when you save the IconSet, which is setup to save the IconGraphic attributes. I know this is complicated.. I may just have to go to editing each icon individually, but if anyone can help, I would appreciate it.

    Read the article

  • layout is not included in all pages in asp.net mvc4 application

    - by Ahmed
    I am developing an asp.net mvc4 application with Bootstrap 3 and i've _Layout.cshtml in "Shared" folder , in Views, i've two pages, "Index and "Register" and i've included Layout in both of these Views but It seems that Layout is included in only "Index and not in "Register" View. Following are my Index and Register Views @{ ViewBag.Title = "Index"; Layout = "~/Views/Shared/_Layout.cshtml"; } <h2 align="center" class="bg-info">Login</h2> <form class="form-horizontal" role="form"> <div class="form-group"> <label for="inputEmail3" class="col-sm-2 control-label"><strong>UserName : </strong></label> <div class="col-sm-10"> <input type="email" class="form-control" id="inputEmail3" placeholder="UserName"> </div> </div> <div class="form-group"> <label for="inputPassword3" class="col-sm-2 control-label"><strong>Password</strong></label> <div class="col-sm-10"> <input type="password" class="form-control" id="inputPassword3" placeholder="Password"> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> <div class="checkbox"> <label> <input type="checkbox"> Remember me </label> </div> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> <button type="submit" class="btn btn-primary">Sign in</button> </div> </div> <h2 align="center" class="bg-info">SignIn With Other Services</h2> </form> <form class="form-horizontal" role="form" method="post" action="/Home/FacebookLogin"> <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> <button type="submit" class="btn btn-primary">SignIn with Facebook</button> </div> </div> </form> <h2 align="center" class="bg-info">Don't Have an Account?</h2> <form class="form-horizontal" role="form" method="post" action="/Home/Register"> <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> <button type="submit" class="btn btn-primary">Register</button> </div> </div> </form> ![@{ ViewBag.Title = "Register"; Layout = "~/Views/Shared/_Layout.cshtml"; } <h2 align="center" class="bg-info">Register</h2> <form class="form-horizontal" role="form"> <div class="form-group"> <label for="inputEmail3" class="col-sm-2 control-label"><strong>UserName : </strong></label> <div class="col-sm-10"> <input type="email" class="form-control" id="uname" name="uname" placeholder="UserName"> <input type="button" class="btn btn-primary" id="check" value="Check Availability" > <h4 class="bg-warning"></h4> </div> </div> <div class="form-group"> <label for="inputPassword3" class="col-sm-2 control-label"><strong>Password</strong></label> <div class="col-sm-10"> <input type="password" class="form-control" id="upass" name="upass" placeholder="Password"> </div> </div> <div class="form-group"> <label for="inputPassword3" class="col-sm-2 control-label"><strong>Retype Password</strong></label> <div class="col-sm-10"> <input type="password" class="form-control" id="retype" placeholder="Password"> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> <button type="submit" class="btn btn-primary">Register</button> </div> </div> </form>]

    Read the article

  • I want to style within JS

    - by 422
    Issue I have is I can use tags, but I would like to style particular words. Adding a class doesnt work, is it because I am within script dom ? Example: var config = [ { "name" : "tour_1", "bgcolor" : "black", "color" : "white", "position" : "BR", "text" : "Customize your user profile, it's easy. This is your shop window on <strong>here</strong> and <strong>there</strong>", "time" : 4000 } Instead of strong, I would like to apply class, like <p class="orange"> But it wont have it, any suggestions... please

    Read the article

  • Problems with tk85.dll when shutting down an application that embeds the Python interpreter.

    - by George Edison
    My C++ application embeds the Python interpreter, but seems to be having some trouble when it shuts down. Right after the main window closes, I get a segmentation fault (this is Windows, but we'll call it a segmentation fault anyway). The stack trace is below: #0 102AD580 tk85!Tk_MainWindow() (C:\Users\Nathan\Documents\Projects\PowerPad 1.3\bin\Debug\lib\tk85.dll:??) #1 103082DD tk85!XSetStipple() (C:\Users\Nathan\Documents\Projects\PowerPad 1.3\bin\Debug\lib\tk85.dll:??) #2 102214A3 ??() (C:\Users\Nathan\Documents\Projects\PowerPad 1.3\bin\Debug\lib\tk85.dll:??) #3 10220000 ??() (??:??) #4 00000000 ??() (??:??) Where would I even begin to debug this problem?

    Read the article

  • Home server running 2008 R2 intermittently bringing our internet down by creating a large amount of connections [closed]

    - by Philip Strong
    Possible Duplicate: My server's been hacked EMERGENCY My Server 2008 R2 home server is intermittently (every 30 minutes or so, for about 3-4 minutes) creating a huge amount of connections which reaches the 4096 connection limit, thus effectively DOSing our internet connection. I've run a couple of network traffic monitors, and it appears to be a system process causing the problem. I thought I'd fixed it by reinstalling Comodo Antivirus, but it appears that wasn't the problem. Any thought? Thanks in advance.

    Read the article

  • Problem with IE and Jquery qTip plugin

    - by user272899
    I am having problems with the Jquery qtip plugin. It works fine in Firefox (see here http://movieo.no-ip.org/ hover over the first image). But doesn't work in IE. This is the code: $('.moviebox').each(function() { $(this).qtip({ content: $(this).children('.info'), show: 'mouseover', hide: 'mouseout', style: { name: 'light' }, position: { corner: { target: 'rightbottom', tooltip: 'bottomleft' } } }); }); And the html <!--start moviebox--> <div class="moviebox"> <a href="#"> <img src="http://1.bp.blogspot.com/_mySxtRcQIag/S6deHcoChaI/AAAAAAAAObc/Z1Xg3aB_wkU/s200/rising_sun.jpg" /> </a> <!--start infobox--> <div class="info"> <span>Rising Sun (2006)</span> <div class="description"><strong>Description:</strong><br /> test test test test test test test test test test test test test test test test</div> <img src="http://1.bp.blogspot.com/_mySxtRcQIag/S6deHcoChaI/AAAAAAAAObc/Z1Xg3aB_wkU/s200/rising_sun.jpg" /> <div class="cast"><strong>Cast:</strong><br /> Sean connery</div> <div class="rating"><strong>Rating:</strong><br />5stars</div> </div> <!--end infobox--> </div> <!--end moviebox--> Why wouldn't that work in IE????? Beats me. Checkout movieo.no-ip.org for the whole source

    Read the article

  • CSS background images not showing in IE?

    - by Kevin
    In IE8 and below, I'm doing this <ul class="dependants_list" style="border-bottom: dashed 1px #53a1dc"> <li class="dependants_summary"> <strong>Name:</strong> De Silva, Angelina<br /> <strong>Gender:</strong> Female<br /> <strong>Date of birth:</strong> 7/3/2009<br /> </li> <form action="/Dependant/Delete/11413" method="get"><input class="delete btn" id="Delete_this_Profile" name="Delete_this_Profile" type="submit" value="Delete this Profile" /> </form><form action="/Dependant/Edit/11413" method="get"><input class="edit btn" id="Modify_this_Profile" name="Modify_this_Profile" type="submit" value="Modify this Profile" /> </form><br /><hr style="display:none" /> and the CSS for it is: .dependants_summary { overflow: hidden; margin-bottom: 10px; padding-right: 0px; padding-left: 85px; padding-top: 5px; padding-bottom: 5px; width: 430px; float: left; font: 120% Arial, Helvetica, sans-serif; } .dependants_list { padding: 0; } .dependants_list li:nth-child(odd) { background: #fff url("../images/dependant_male.png") no-repeat scroll 8px 9px; } .dependants_list li:nth-child(even) { background: #c9e3f4 url("../images/dependant_male.png") no-repeat scroll 8px 9px; } The images are not being shown in IE, but they are in ffox and chrome

    Read the article

  • JSoup - Select only one listobject

    - by Zyril
    I'm trying to extract some certain data from a website using JSoup and Java. So far I've been successful in what I'm trying to achieve. <ul class="beverageFacts"> <li><span>Årgång</span><strong>**2009**&nbsp;</strong></li> I want to extract what is inside the ** in the above HTML. I can do this by using the code that follows in JSoup: doc.select("ul.beverageFacts li:lt(1) strong"); I'm using the lt(1) because there are several more list items following that I want to omit. Now to my problem; there's an optional information tab on the site I'm extracting data from, and it also has a class called "beverageFacts". My code will at the moment extract that data too, which I don't want it to do. The code is further down in the source of the website, and I've tried to use the indexer :lt(1) here aswell, but it wont work. <div id="beverageMoreFacts" style="display: block"> <ul class="beverageFacts"><li class="half"> <span> Färg</span><strong> Ljusgul färg.</strong> My overall result is that I extract "2009 Ljusgul färg." instead of only "2009". How can I write my code so it will only extract the first part, which it succesfully does, and omits the rest? EDIT: I get the same result using: doc.select("ul.beverageFacts li:eq(0) strong"); Thanks, Z

    Read the article

  • What would be the best way to dynamically add a set of rows to a table using JQuery?

    - by user312157
    I have a following table using MVC that shows number of items the user has. <table border = "1" id="tblItems"> <% var itemnum = 1; foreach (var item in Model.Items) {%> <tr> <td colspan="2" bgcolor="Silver"><strong>Item#<%=itemnum%></strong></td> <td><%=Html.ActionLink("Delete", "DeleteItem", "Item", new { id = item.ID })%></td> </tr> <tr> <td><strong>Name:</strong></td> <td><%=Html.TextBox("ItemName_" + itemnum, item.Name)%></td> </tr> <tr> <td><strong>Description:</strong></td> <td><%=Html.TextBox("ItemDescription_" + itemnum, item.Description)%></td> </tr> <%itemnum++; } %> </table> I will have a button that will Add New Item that will dynamically add identical structure. Any ideas on what is the best way to do this using JQuery? Thanks for all the suggestions!

    Read the article

  • RoR - howto convert some HTML-elements with css to Rails

    - by NicoJuicy
    I have old HTML code with html and css.. <form action="login" method="post"> <div class="field"> <label for="username">Username</label> <input type="text" class="text" id="username" name="username" value="just click login !"/> </div> <span class="fright"> <button class="button" type="submit"><strong>Log In</strong></button> </span> </div> How can i convert this code to decent rails code? I came up with this, but it ain't right :-( : <% form_for :user, @user, :url => { :action => "login" } do |f| %> <% div_for f, :class => "field text" do %> <%= f.text_field :username %> <%= f.password_field :password, :class => "field text" %> <% end %> <span class="fright"> <%= submit_tag '<strong>Inloggen</strong>', :class => "button",:disable_with => 'verwerken...' %></span> <% end %> I'm having problems with the <strong>Inloggen</strong> And with the <% div_for f, :class => "field text" do %>

    Read the article

  • Dom Nodes manipulations, how remove tags which wrap my selection?

    - by sanceray3
    Hi, I try to explain you my "problem". I would like to know when I select a part of text, if this text is “wrapped” by html tags, and in function delete them. For example with this sentence : The car is <strong>green</strong>, and the boat is black If I select “green” and click on a button, I would like verify if green is wrapped by <strong>(for that it’s ok), and in function delete <strong> tags without delete containing “green”. I have tried to do it, but when I remove child and recreate one, my new node is empty and if I try to put directly text in document.createTextNode, my new node appears but the <strong> tags stay. // Bouton CLICK $('input[type=button].btn_transform').click(function(){ var selObj = window.getSelection(); var parent=selObj.anchorNode.parentNode; if (parent.nodeName=='STRONG'){ parent.removeChild(selObj.anchorNode); var theText = document.createTextNode(selObj); parent.appendChild(theText); } }); I’m not a DOM manipulation specialist. Could you help me to solve this? Thanks very much for your precious help.

    Read the article

  • jquery .children() returning wrong size

    - by i need help
    Hi guys, I just found the children size not consistent. Below attach full code with alert, for easy reference. Is the way I get the data wrong? <body> <table width="100" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="30" valign="top"><strong>Header Title</strong></td> </tr> <tr> <td height="32" valign="top">Date : <strong>01/01/2010 </strong> <br><div><b></b></div><span></span></td> </tr> </table> </body> $("td").each(function() { alert($(this).children().size()); }); //first td showing 1 direct children- <strong> //second td showing 4 direct children- <strong> <br> <div> <span> ----- $("tr").each(function() { alert($(this).children().size()); }); //first tr showing 1 direct children - <td> //second tr showing 1 direct children - <td> ----- $("table").each(function() { alert($(this).children().size()); }); // ERROR // this table showing 1 direct children only.... something WRONG. // I thought there are 2 <tr> inside this table?

    Read the article

  • How To Deal With Terrible Design Decisions

    - by splatto
    I'm a consultant at one company. There is another consultant who is a year older than me and has been here 3 months longer than I have, and a full time developer. The full-time developer is great. My concern is that I see the consultant making absolutely terrible design decisions. For example, M:M relationships are being stored in the database as a comma-delimited string rather than using a conjunction table to hold the relationships. For example, consider two tables, Car and Property: Car records: Camry Volvo Mercedes Property records: Spare Tire Satellite Radio Ipod Support Standard Rather than making a table CarProperties to represent this, he has made a "Property" attribute on the Car table whose data looks like "1,3,7,13,19,25," I hate how this decision and others are affecting the quality of my code. We have butted heads over this design three times in the past two months since I've been here. He asked me why my suggestion was better, and I responded that our database would be eliminating redundant data by converting to a higher normal form. I explained that this design flaw in particular is discussed and discouraged in entry level college programs, and he responded with a shot at me saying that these comma-separated-value database properties are taught when you do your masters (which neither of us have). Needless to say, he became very upset and demanded I apologize for criticizing his work, which I did in the interest of not wanting to be the consultant to create office drama. Our project manager is focused on delivering a product ASAP and is a very strong personality - Suggesting to him at this point that we spend some time to do this right will set him off. There is a strong likelihood that both of our contracts will be extended to work on a second project coming up. How will I be able to exert dominant influence over the design of the system and the data model to ensure that such terrible mistakes are not repeated in the next project? A glimpse at the dynamics: I can be a strong personality if I don't measure myself. The other consultant is not a strong personality, is a poor communicator, is quite stubborn and thinks he is better than everyone else. The project manager is an extremely strong personality who is focused on releasing tomorrow's product yesterday. The full-time developer is very laid back and easy going, a very effective communicator, but is someone who will accept bad design if it means not rocking the boat. Code reviews or anything else that takes "time" will be out of the question - there is no way our PM will be sold on such a thing by anybody.

    Read the article

  • WebCenter Customer Spotlight: Alberta Agriculture and Rural Developmen

    - by me
    Author: Peter Reiser - Social Business Evangelist, Oracle WebCenter  Solution SummaryAlberta Agriculture and Rural Development is a government ministry that works with producers and consumers to create a strong, competitive, and sustainable agriculture and food industry in the province of Alberta, Canada The primary business challenge faced by the Alberta Ministry of Agriculture was that of managing the rapid growth of their information.  They needed to incorporate a system that would work across 22 different divisions within the ministry and deliver an improved and more efficient experience for Desktop, Web and Mobile users, while addressing their regulatory compliance needs as part of the Canadian government. The customer implemented a centralized Enterprise Content Management solution based on Oracle WebCenter Content and developed a strong and repeatable information life cycle management methodology across all their 22 divisions and agencies. With the implemented solution, Alberta Agriculture and Rural Development  centrally manages over 20 million documents for 22 divisions and agencies and they have improved time required to find records,  reliability of information, improved speed and accuracy of reporting and data security. Company OverviewAlberta Agriculture and Rural Development is a government ministry that works with producers and consumers to create a strong, competitive, and sustainable agriculture and food industry in the province of Alberta, Canada.  Business ChallengesThe business users were overwhelmed by growth in documents (over 20 million files across 22 divisions and agencies) and it was difficult to find and manage documents and versions. There was a strong need for a personalized easy-to-use, secure and dependable method of managing and consuming content via desktop, Web, and mobile, while improving efficiency and maintaining regulatory compliance by removing the risk of non-uniform approaches to retention and disposition. Solution DeployedAs a first step Alberta Agriculture and Rural Development developed a business case with clear defined business drivers: Reduce time required to find records Locate “lost” records Capture knowledge lost through attrition Increase the ease of retrieval Reduce personal copies Increase reliability of information Improve speed and accuracy of reporting Improve data security The customer implemented a centralized Enterprise Content Management solution based on Oracle WebCenter Content. They used an incremental implementation approach aligned with their divisional and agency structure which allowed continuous process improvement. This led to a very strong and repeatable information life cycle management methodology across all their 22 divisions and agencies. Business ResultsAlberta Agriculture and Rural Development achieved impressive business results: Centrally managing over 20 million files for 22 divisions and agencies Federated model to manage documents in SharePoint and other applications Doing records management for both paper and electronic records Reduced time required to find records Increased the ease of retrieval Increased reliability of information Improved speed and accuracy of reporting Improved data security Additional Information Oracle Open World 2012 Presentation Oracle WebCenter Content

    Read the article

  • Tokyo Tyrant ulog / update log management.

    - by Nathan Milford
    I'm testing Tokyo Tyrant in a master-master setup and have found the ulog grows out of control and locks up the disk. At first I found the -ulim option useful and limited the logfile size, however it simply rolls over to a new log, leaving the old ones to clutter up the partition. I suppose I'll write a shell script that will delete ulogs older than X, once I find out how far back Tokyo Tyrant needs in the update log in order to failover. Does anyone have any experience with this Tokyo Tyrant? Do you have a feel (acknowledging that every install is different based on what is being stored) for the optimal ulog size vs how far back a Tokyo Tyrant instance needs to look in the ulog to assume master status? Thanks, nathan

    Read the article

  • Windows XP won't boot after drive transplant

    - by Nathan
    Hi all, I moved my hard drive from my Lenovo laptop into my Asus Eee PC netbook. When I started the netbook, after POST all I got was a black screen with a cursor in the upper left corner. I thought that the migration should work OK because this was a 32-bit version of Windows XP, and the Atom processor in the Asus should support the x86 instruction set. However, I don't know much about Windows, so maybe this was a dumb thought. I did verify that the BIOS can find the drive. It required major surgery to replace the drive, so any solution requiring me to remove the transplant drive is not going to fly. Keeping in mind that the netbook has no optical drive and that I have no other Windows computers (all my other computers run Linux), is there any way I can fix this problem? Thanks! Nathan

    Read the article

  • Blinking cursor after repair install on Win XP

    - by Nathan
    I have an Asus Eee PC netbook which I upgraded the drive of. After some shenanigans, I was able to do a repair install from my Windows XP CD. However, I still have a blinking cursor in the upper-left-hand corner after POST. I tried going into the recovery console and doing chkdsk/fixboot/fixmbr with no effect. Any suggestions would be appreciated! (Sorry if it's inappropriate to post a followup as a new question; I'm not sure how I should do it in a way that will cause it to actually be seen). Thanks, Nathan

    Read the article

  • Using returned XML from an authorised HTTP request in vb.NET

    - by Nathan
    Hi, How can I use the returned XML from the reader in a xmltextreader? ' Create the web request request = DirectCast(WebRequest.Create("https://mobilevikings.com/api/1.0/rest/mobilevikings/sim_balance.xml"), HttpWebRequest) ' Add authentication to request request.Credentials = New NetworkCredential("username", "password") ' Get response response = DirectCast(request.GetResponse(), HttpWebResponse) ' Get the response stream into a reader reader = New StreamReader(response.GetResponseStream()) Thanks in advance, Nathan.

    Read the article

  • Rails ActiveRecord: Select Posts WITHOUT comments

    - by Nathan
    I have a a Comments table and a Posts table, where a Post has many comments and a comment belongs to a post (i.e. it has a post_id in the table). How can I efficiently select the last ten Posts that DO NOT have comments. I can't seem to accomplish this without first selecting all the posts and checking each for a 0 comment count. Thanks in advance for any help. -Nathan

    Read the article

  • Avoiding denormal values in C++

    - by Nathan
    Hi, After search a long time for a performance bug, I read abut denormal foating point values. I have an Intel Core 2 Duo and I am compiling with gcc, using "-O2". So what do I do? Can I somehow instruct g++ to avoid denormal values? If not, can I somehow test if a float is denormal? Thanks! Nathan

    Read the article

  • JavaScript issues

    - by Michael
    My java scirpt is not working right. It is simple pre-vailidation form and I can not get the script to work. It is supposed to validate each field but I can not get it to validate past the first name. I stripped out all of the other garbage so the code would not be confusing Should be a copy paste to notepad. Little help please <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script language="JavaScript" type="text/javascript"> <!-- function validateForm(theForm) { var name = theForm.firstname.value; var name = theForm.lastname.value; var email = theForm.email.value; if (name == "") { alert("Please fill in your First Name."); theForm.firstname.focus(); return false; } if (name == "") { alert("Please fill in your Last Name."); theForm.lastname.focus(); return false; } if (email == "") { alert("Please fill in your email address."); theForm.email.focus(); return false; } return true; } //--> </script> if (!theForm.myCheckbox1.checked { alert("Please check the honor box."); return false; } </head> <body> </script> <fieldset> <legend>Fun in the Sun With JavaScirpt</legend> <ul> <form action="blah.cgi" method="post" onSubmit="return validateForm(this);"> First name: <input type="text" name="firstname"> <font color="#FF0000" size="1" face="Arial, Helvetica, sans-serif"><strong>*</strong></font> <br><br> Last name: <input type="text" name="lastname"> <font color="#FF0000" size="1" face="Arial, Helvetica, sans-serif"><strong>*</strong></font> <br><br> Email address: <input type="text" name="email"> <font color="#FF0000" size="1" face="Arial, Helvetica, sans-serif"><strong>*</strong></font> <br><br> Phone Number: <input type="text" name="phone"><br><br> <input type="submit" name="submit" value="Submit"> </form> <input type="checkbox" name="myCheckbox" value="someValue"><font color="#FF0000" size="1" face="Arial, Helvetica, sans-serif"><strong>*</strong></font> <P>By checking this Box you are confirming the data is accurate</p> <p>(* indicates a required field)</p> </body> </html>

    Read the article

  • ASP.NET MVC - Form Post always redirect when I just want to bind json result to a div

    - by Saxman
    Hi all, I'm having a little problem with json result. I'm submitting a contact form, and after the submission, I just want to return some json data (indicating either a success or failed and displays a message) back to the view, without causing a redirect, but it kept redirecting me to the action, here are the codes: HTML <div id="contactForm2" class="grid_6"> <div id="contactFormContainer"> @using (Html.BeginForm(MVC.Home.ActionNames.ContactForm, MVC.Home.Name, FormMethod.Post, new { id = "contactForm" })) { <p> <input type="text" tabindex="1" size="22" value="" id="contactName" class="text_input required" name="contactName" /> <label for="contactName"> <strong class="leftSpace">Your Name (required)</strong></label></p> <p> <input type="text" tabindex="2" size="22" value="" id="contactEmail" class="text_input required" name="contactEmail" /> <label for="contactEmail"> <strong class="leftSpace">Email (required)</strong></label></p> <p> <input type="text" tabindex="2" size="22" value="" id="contactPhone" class="text_input" name="contactPhone" /> <label for="contactPhone"> <strong class="leftSpace">Phone</strong></label></p> <p> <label> <strong class="leftSpace n">Message (required)</strong></label> <textarea tabindex="4" rows="4" cols="56" id="contactMessage" class="text_area required" name="contactMessage"></textarea></p> <p> <input type="submit" value="Send" tabindex="5" id="contactSubmit" class="button submit" name="contactSubmit" /></p> } </div> <div id="contactFormStatus"> </div> </div> Controller [HttpPost] public virtual JsonResult ContactForm(FormCollection formCollection) { var name = formCollection["contactName"]; var email = formCollection["contactEmail"]; var phone = formCollection["contactPhone"]; var message = formCollection["contactMessage"]; if (string.IsNullOrEmpty(name) || string.IsNullOrEmpty(email) || string.IsNullOrEmpty(message)) { return Json(new { success = false, message = "Please complete all the required fields so that I can get back to you. Thanks." }); } // Insert contact form data here... return Json(new { success = true, message = "Your inquery has been sent. Thank you." }); } javascript $(document).ready(function () { $('#contactSubmit').live('click', function () { var form = $('#contactForm'); var formData = form.serialize(); $.post('/Home/ContactForm', formData, function (result) { var status = $('#contactFormStatus'); if (result.success) { $('#contactForm')[0].reset; } status.append(result.message); }, 'json' ); return false; }); }); I've also tried this javascript, but also got a redirect $(document).ready(function () { $('#contactSubmit').live('click', function () { var form = $('#contactForm'); var formData = form.serialize(); $.ajax({ type: 'POST', url: '/Home/ContactForm', data: formData, success: function (result) { SubmitContactResult(result); }, cache: false }); }); function SubmitContactResult(result) { var status = $('#contactFormStatus'); if (result.success) { $('#contactForm')[0].reset; } status.append(result.message); } }); Any idea what's going on with my code? Thank you very much.

    Read the article

  • How to display same type of data from XML using XSLT

    - by MKS
    Hi Guys, I am using XSLT and XML. I have got below XML. <documentCountryInformation> <countryCode>US</countryCode> <countryName>United States</countryName> <sufficientDocumentation>Conditional</sufficientDocumentation> <sectionInformation> <sectionName>Health</sectionName> <documentParagraph paragraphId="23628"> <paragraphType>Requirement</paragraphType> <paragraphText> <p> Vaccination for <strong>yellow fever</strong> Persons without valid yellow fever certification, if required, are subject to quarantine for a period up to 6 days. </p> </paragraphText> </documentParagraph> </sectionInformation> </documentCountryInformation> <documentCountryInformation> <countryCode>IN</countryCode> <countryName>India</countryName> <sufficientDocumentation>Conditional</sufficientDocumentation> <sectionInformation> <sectionName>Health</sectionName> <documentParagraph paragraphId="23648"> <paragraphType>Requirement</paragraphType> <paragraphText> <p> Vaccination for <strong>Dengue fever</strong> Persons without valid yellow fever certification, if required, are subject to quarantine for a period up to 3 days. </p> </paragraphText> </documentParagraph> </sectionInformation> </documentCountryInformation> Above is the part of full xml and you can see there are two records of same type, now I have got the <countryName> in parameters of XSLT in above example my countryName parameter will contain this type of data "United States,India", Now I want to split the parameter data and further it will check the XML having same country name and display the data according, I mean there will be loop on country name and below is desired HTML. <div class="resultsContainer" id="divTransit"> <h3>Transit - United States (US)</h3> <p> Vaccination for <strong>yellow fever</strong> Persons without valid yellow fever certification, if required, are subject to quarantine for a period up to 6 days. </p> <h3>Transit - India (IN)</h3> <p> Vaccination for <strong>Dengue fever</strong> Persons without valid yellow fever certification, if required, are subject to quarantine for a period up to 3 days. </p> </div>

    Read the article

  • Why my onsubmitg is not firing - Spring

    - by GigaPr
    Hi, i have a controller public class EditUserController extends BaseController { public EditUserController() { setCommandClass(User.class); setCommandName("editaUser"); } public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { ModelAndView modelAndView = new ModelAndView("editUser"); String id = request.getParameter("id"); if(!id.isEmpty()) { User user = this.userServiceImplementation.get(Integer.parseInt(id)); modelAndView.addObject("editaUser", user); } return modelAndView; } } and the view <form:form method="POST" commandName="editaUser" cssClass="addUserForm"> <div class="floatL"> <div class="padding5"> <div class="fieldContainer"> <strong>First Name:</strong>&nbsp; </div> <form:errors path="firstName" cssClass="error"/> <form:input path="firstName" cssClass="textArea" /> </div> <div class="padding5"> <div class="fieldContainer"> <strong>Last Name:</strong>&nbsp; </div> <form:errors path="lastName" cssClass="error"/> <form:input path="lastName" cssClass="textArea" /> </div> </div> <div class="floatR"> <div class="padding5"> <div class="fieldContainer"> <strong>Username:</strong>&nbsp; </div> <form:errors path="username" cssClass="error"/> <form:input path="username" cssClass="textArea" /> </div> <div class="padding5"> <div class="fieldContainer"> <strong>Password</strong>&nbsp; </div> <form:errors path="password" cssClass="error"/> <form:input path="password" cssClass="textArea"/> </div> </div> <input type="submit" class="floatR" value="Save" > </form:form> and the bean definition looks like <bean name="/editUser.htm" class="com.rssFeed.mvc.EditUserController"> <property name="userServiceImplementation" ref="userServiceImplementation"/> <property name="commandName" value="editaUser" /> <property name="successView" value="users"/> <property name="sessionForm" value="true"/> </bean> I populate the view using the querystring but i would lke to update the record in the database on click of the submit button. i tried to insert a on submit method protected ModelAndView onSubmit(Object command, BindException bindException) throws Exception { return new ModelAndView(getSuccessView()); } but it never fires What is the problem i do not get it?? thanks

    Read the article

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