Search Results

Search found 23207 results on 929 pages for 'node form'.

Page 14/929 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • PDF form (not) saving

    - by gregseth
    Hi, I've created a form in a PDF with Adobe Acrobat Pro. When empy, I want to use it as a template which the user opens, fills in, and saves as a copy to preserve the blank state of the template. Here's the trick : I found both ways to make the document read only - the user can't save the form value, only print them make the document writeable, but in this case the document acting as a template can be modified too. Any ideas? Thanks.

    Read the article

  • Retrieving XML node from a path specified in an attribute value of another node

    - by Olivier PAYEN
    From this XML source : <?xml version="1.0" encoding="utf-8" ?> <ROOT> <STRUCT> <COL order="1" nodeName="FOO/BAR" colName="Foo Bar" /> <COL order="2" nodeName="FIZZ" colName="Fizz" /> </STRUCT> <DATASET> <DATA> <FIZZ>testFizz</FIZZ> <FOO> <BAR>testBar</BAR> <LIB>testLib</LIB> </FOO> </DATA> <DATA> <FIZZ>testFizz2</FIZZ> <FOO> <BAR>testBar2</BAR> <LIB>testLib2</LIB> </FOO> </DATA> </DATASET> </ROOT> I want to generate this HTML : <html> <head> <title>Test</title> </head> <body> <table border="1"> <tr> <td>Foo Bar</td> <td>Fizz</td> </tr> <tr> <td>testBar</td> <td>testFizz</td> </tr> <tr> <td>testBar2</td> <td>testFizz2</td> </tr> </table> </body> </html> Here is the XSLT I currently have : <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"> <xsl:output method="html" indent="yes"/> <xsl:template match="/ROOT"> <html> <head> <title>Test</title> </head> <body> <table border="1"> <tr> <!--Generate the table header--> <xsl:apply-templates select="STRUCT/COL"> <xsl:sort data-type="number" select="@order"/> </xsl:apply-templates> </tr> <xsl:apply-templates select="DATASET/DATA" /> </table> </body> </html> </xsl:template> <xsl:template match="COL"> <!--Template for generating the table header--> <td> <xsl:value-of select="@colName"/> </td> </xsl:template> <xsl:template match="DATA"> <xsl:variable name="pos" select="position()" /> <tr> <xsl:for-each select="/ROOT/STRUCT/COL"> <xsl:sort data-type="number" select="@order"/> <xsl:variable name="elementName" select="@nodeName" /> <td> <xsl:value-of select="/ROOT/DATASET/DATA[$pos]/*[name() = $elementName]" /> </td> </xsl:for-each> </tr> </xsl:template> </xsl:stylesheet> It almost works, the problem I have is to retrieve the correct DATA node from the path specified in the "nodeName" attribute value of the STRUCT block.

    Read the article

  • How to debug a Gruntfile with breakpoints using node-inspector?

    - by Kris Hollenbeck
    So I have spent the past couple days trying to get this to work with no luck. Most of the solutions I have found seem to work "okay" for debugging node applications. But I haven't had much luck debugging grunt stand alone. I would like to be able to set breakpoints in my gruntfile and either step through the code with either the browser or an IDE. I have tried the following: Debugging using intelliJ IDE Using Grunt Console (Process finished with exit code 6) Debugging with Nodeeclipse (This sort of works okay but doesn't hit the breakpoints set in eclipse, not very intuitive) Debugging using node-inspector (This one also sort of works. I can step through a little ways using F11 and F10 in chrome. But eventually it just crashes. Using F8 to skip to break point never works.) ERROR MESSAGE USING NODE-INSPECTOR So currently node-inspector feels like it has gotten me the closest to what I want. To get here I did the following: From my grunt directory I ran the following commands: grunt node-inspector node --debug-brk Gruntfile.js And then from there I went to localhost:8080/debug?port=5858 to debug my Gruntfile.js. But like I mentioned above, as soon as I hit F8 to skip to breakpoint it crashes with the above error. Has anybody had any success using this method to try to debug a Gruntfile? So far from my search efforts I have not found a very well documented way of doing this. So hopefully this will be useful or beneficial information for future users. Also I am using Windows 7 by the way. Thanks in advance.

    Read the article

  • Using a checkbox input on a form to send the form data to different email addresses

    - by Cody Thomas
    I am building a form for a client. Here is the rundown. The form will be used as a request to have a staff member contact the person filling out the form. However, there is a list of staff members that will contact them depending on what the subject matter is. So, I want to create a checkbox input section on the form with each staff person's email address attached to a corresponding checkbox. So, the person filling out the form can check only the staff people necessary for their needs. Finally, when the person clicks "submit", the form will be emailed to only the staff members who were checked in the form. I'm at a loss of how to set this up.

    Read the article

  • Reworking my singly linked list

    - by Stradigos
    Hello everyone, thanks for taking the time to stop by my question. Below you will find my working SLL, but I want to make more use of C# and, instead of having two classes, SLL and Node, I want to use Node's constructors to do all the work (To where if you pass a string through the node, the constructor will chop it up into char nodes). The problem is, after an a few hours of tinkering, I'm not really getting anywhere... using System; using System.Collections.Generic; using System.Text; using System.IO; namespace PalindromeTester { class Program { static void Main(string[] args) { SLL mySLL = new SLL(); mySLL.add('a'); mySLL.add('b'); mySLL.add('c'); mySLL.add('d'); mySLL.add('e'); mySLL.add('f'); Console.Out.WriteLine("Node count = " + mySLL.count); mySLL.reverse(); mySLL.traverse(); Console.Out.WriteLine("\n The header is: " + mySLL.gethead); Console.In.ReadLine(); } class Node { private char letter; private Node next; public Node() { next = null; } public Node(char c) { this.data = c; } public Node(string s) { } public char data { get { return letter; } set { letter = value; } } public Node nextNode { get { return next; } set { next = value; } } } class SLL { private Node head; private int totalNode; public SLL() { head = null; totalNode = 0; } public void add(char s) { if (head == null) { head = new Node(); head.data = s; } else { Node temp; temp = new Node(); temp.data = s; temp.nextNode = head; head = temp; } totalNode++; } public int count { get { return totalNode; } } public char gethead { get { return head.data; } } public void traverse() { Node temp = head; while(temp != null) { Console.Write(temp.data + " "); temp = temp.nextNode; } } public void reverse() { Node q = null; Node p = this.head; while(p!=null) { Node r=p; p=p.nextNode; r.nextNode=q; q=r; } this.head = q; } } } } Here's what I have so far in trying to work it into Node's constructors: using System; using System.Collections.Generic; using System.Text; using System.IO; namespace PalindromeTester { class Program { static void Main(string[] args) { //Node myList = new Node(); //TextReader tr = new StreamReader("data.txt"); //string line; //while ((line = tr.ReadLine()) != null) //{ // Console.WriteLine(line); //} //tr.Close(); Node myNode = new Node("hello"); Console.Out.WriteLine(myNode.count); myNode.reverse(); myNode.traverse(); // Console.Out.WriteLine(myNode.gethead); Console.In.ReadLine(); } class Node { private char letter; private Node next; private Node head; private int totalNode; public Node() { head = null; totalNode = 0; } public Node(char c) { if (head == null) { head = new Node(); head.data = c; } else { Node temp; temp = new Node(); temp.data = c; temp.nextNode = head; head = temp; } totalNode++; } public Node(string s) { foreach (char x in s) { new Node(x); } } public char data { get { return letter; } set { letter = value; } } public Node nextNode { get { return next; } set { next = value; } } public void reverse() { Node q = null; Node p = this.head; while (p != null) { Node r = p; p = p.nextNode; r.nextNode = q; q = r; } this.head = q; } public void traverse() { Node temp = head; while (temp != null) { Console.Write(temp.data + " "); temp = temp.nextNode; } } public int count { get { return totalNode; } } } } } Ideally, the only constructors and methods I would be left with are Node(), Node(char c), Node(string s), Node reserve() and I'll be reworking traverse into a ToString overload. Any suggestions?

    Read the article

  • How to pass email from one form to another page's form with javascript

    - by zac
    I am trying to have an email signup form on one page populate the email block on another page by passing it through the url and pulling it out with document.write. The first form is something like: <form action="/sign-up"> <input type="text" name="passEmail"><input type="submit"></form> And the recieving form is like : <form name="theForm"> <input type='text' name='email'></form> And I am trying a script like this <SCRIPT LANGUAGE="javascript"> var locate = window.location document.theForm.email.value = locate var text = document.theForm.email.value function delineate(str) { theEmail = str.indexOf("=") + 1; return(str.substring(theEmail)); } document.write(delineate(text)); </SCRIPT> Instead of pulling the email after the = in the url it is pulling the entire url. Can someone help me accomplish this?

    Read the article

  • Microsoft TypeScript : A Typed Superset of JavaScript

    - by shiju
    JavaScript is gradually becoming a ubiquitous programming language for the web, and the popularity of JavaScript is increasing day by day. Earlier, JavaScript was just a language for browser. But now, we can write JavaScript apps for browser, server and mobile. With the advent of Node.js, you can build scalable, high performance apps on the server with JavaScript. But many developers, especially developers who are working with static type languages, are hating the JavaScript language due to the lack of structuring and the maintainability problems of JavaScript. Microsoft TypeScript is trying to solve some problems of JavaScript when we are building scalable JavaScript apps. Microsoft TypeScript TypeScript is Microsoft's solution for writing scalable JavaScript programs with the help of Static Types, Interfaces, Modules and Classes along with greater tooling support. TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. This would be more productive for developers who are coming from static type languages. You can write scalable JavaScript  apps in TypeScript with more productive and more maintainable manner, and later you can compiles to plain JavaScript which will be run on any browser and any OS. TypeScript will work with browser based JavaScript apps and JavaScript apps that following CommonJS specification. You can use TypeScript for building HTML 5 apps, Node.JS apps, WinRT apps. TypeScript is providing better tooling support with Visual Studio, Sublime Text, Vi, Emacs. Microsoft has open sourced its TypeScript languages on CodePlex at http://typescript.codeplex.com/    Install TypeScript You can install TypeScript compiler as a Node.js package via the NPM or you can install as a Visual Studio 2012 plug-in which will enable you better tooling support within the Visual Studio IDE. Since TypeScript is distributed as a Node.JS package, and it can be installed on other OS such as Linux and MacOS. The following command will install TypeScript compiler via an npm package for node.js npm install –g typescript TypeScript provides a Visual Studio 2012 plug-in as MSI file which will install TypeScript and also provides great tooling support within the Visual Studio, that lets the developers to write TypeScript apps with greater productivity and better maintainability. You can download the Visual Studio plug-in from here Building JavaScript  apps with TypeScript You can write typed version of JavaScript programs with TypeScript and then compiles it to plain JavaScript code. The beauty of the TypeScript is that it is already JavaScript and normal JavaScript programs are valid TypeScript programs, which means that you can write normal  JavaScript code and can use typed version of JavaScript whenever you want. TypeScript files are using extension .ts and this will be compiled using a compiler named tsc. The following is a sample program written in  TypeScript greeter.ts 1: class Greeter { 2: greeting: string; 3: constructor (message: string) { 4: this.greeting = message; 5: } 6: greet() { 7: return "Hello, " + this.greeting; 8: } 9: } 10:   11: var greeter = new Greeter("world"); 12:   13: var button = document.createElement('button') 14: button.innerText = "Say Hello" 15: button.onclick = function() { 16: alert(greeter.greet()) 17: } 18:   19: document.body.appendChild(button) .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } The above program is compiling with the TypeScript compiler as shown in the below picture The TypeScript compiler will generate a JavaScript file after compiling the TypeScript program. If your TypeScript programs having any reference to other TypeScript files, it will automatically generate JavaScript files for the each referenced files. The following code block shows the compiled version of plain JavaScript  for the above greeter.ts greeter.js 1: var Greeter = (function () { 2: function Greeter(message) { 3: this.greeting = message; 4: } 5: Greeter.prototype.greet = function () { 6: return "Hello, " + this.greeting; 7: }; 8: return Greeter; 9: })(); 10: var greeter = new Greeter("world"); 11: var button = document.createElement('button'); 12: button.innerText = "Say Hello"; 13: button.onclick = function () { 14: alert(greeter.greet()); 15: }; 16: document.body.appendChild(button); .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } Tooling Support with Visual Studio TypeScript is providing a plug-in for Visual Studio which will provide an excellent support for writing TypeScript  programs within the Visual Studio. The following screen shot shows the Visual Studio template for TypeScript apps   The following are the few screen shots of Visual Studio IDE for TypeScript apps. Summary TypeScript is Microsoft's solution for writing scalable JavaScript apps which will solve lot of problems involved in larger JavaScript apps. I hope that this solution will attract lot of developers who are really looking for writing maintainable structured code in JavaScript, without losing any productivity. TypeScript lets developers to write JavaScript apps with the help of Static Types, Interfaces, Modules and Classes and also providing better productivity. I am a passionate developer on Node.JS and would definitely try to use TypeScript for building Node.JS apps on the Windows Azure cloud. I am really excited about to writing Node.JS apps by using TypeScript, from my favorite development IDE Visual Studio. You can follow me on twitter at @shijucv

    Read the article

  • Microsoft Sql Server driver for Nodejs - Part 2

    - by chanderdhall
    Nodejs, Sql server and Json response with Rest This post is part 2 of Microsoft Sql Server driver for Node js.In this post we will look at the JSON responses from the Microsoft Sql Server driver for Node js. Pre-requisites: If you have read the Part 1 of the series, you should be good. We will be using a framework for Rest within Nodejs - Restify, but that would need no prior learning. Restify: Restify is a simple node module for building RESTful services. It is slimmer than Express. Express is a complete module that has all what you need to create a full-blown browser app. However, Restify does not have additional overhead of templating, rendering etc that would be needed if your app has views. So, as the name suggests it's an awesome framework for building RESTful services and is very light-weight. Set up - You can continue with the same directory or project structure we had in the previous post, or can start a new one. Install restify using npm and you are good to go. npm install restify Go to Server.js and include Restify in your solution. Then create the server object using restify.CreateServer() - SLICK - ha? var restify = require('restify'); var server = restify.createServer(); server.listen(8080, function () { console.log('%s listening at %s', server.name, server.url); }); Then make sure you provide a port for the Server to listen at. The call back function is optional but helps you for debugging purposes. Once you are done, save the file and then go to the command prompt and hit 'node server.js' and you should see the following:   To test the server, go to your browser and type the address 'http://localhost:8080/' and oops you will see an error.   Why is that? - Well because we haven't defined any routes. Let's go ahead and create a route. To begin with I'd like to return whatever is typed in the url after my name and the following code should do it. server.get('/ChanderDhall/:status', function respond(req, res, next) { res.end("hello " + req.params.name + "") }); You can also avoid writing call backs inline. Something like this. function respond(req, res, next) { res.end("Chander Dhall " + req.params.name + ""); } server.get('/hello/:name', respond); Now if you go ahead and type http://localhost:8080/ChanderDhall/LovesNode you will get the response 'Chander Dhall loves node'. NOTE: Make sure your url has the right case as it's case-sensitive. You could have also typed it in as 'server.get('/chanderdhall/:name', respond);' Stored procedure: We've talked a lot about Restify now, but keep in mind the post is about being able to use Sql server with Node and return JSON. To see this in action, let's go ahead and create another route to a list of Employees from a stored procedure. server.get('/Employees', Employees); The following code will return a JSON response.  function Employees(req, res, next) { res.header("Content-Type: application/json"); //Need to specify the Content-Type which is //JSON in our case. sql.open(conn_str, function (err, conn) { if (err) { //Logs an error console.log("Error opening the database connection!"); return; } console.log("before query!"); conn.queryRaw("exec sp_GetEmployees", function (err, results) { if (err) { //Connection is open but an error occurs whileWhat else can be done? May be create a formatter or may be even come up with a hypermedia type but that may upset some pragmatists. Well, that's going to be a totally different discussion and is really not part of this series. Summary: We've discussed how to execute a stored procedure using Microsoft Sql Server driver for Node. Also, we have discussed how to format and send out a clean JSON to the app calling this API.  

    Read the article

  • VFS and FS i-node difference

    - by gaffcz
    What is the difference between VFS i-node and FS (e.g. EXT) i-node? Is it possible that EXT i-node is persistent (contains/points to data blocks), but VFS i-node is created just in i-node cache after read/use of EXT i-node? Or the VFS i-node is just an image of FS i-node (it's the same) and i-nodes in those systems, which are not working with i-nodes (e.g. FAT, NTFS) has to be emulated (HOW?) to allow VFS work with those FS like they would support i-nodes?

    Read the article

  • How to pass an input value from a small form into a big form? (PHP, Javascript, URLs)

    - by sarahdopp
    I have a Wordpress website that needs to display a 3rd party newsletter signup form. This sign-up form has lots of fields and takes up its own full page. I want to display a simple "enter email address, hit submit" form at the top of every page. When the user hits submit, it should take them to the full form, where their email address is already pre-populated in the appropriate field. What's a good way to pass the input value from the short form to the long form? I'm inclined to use the URL somehow, but I've never approached it before. (My skills: expert XHTML/CSS. competent with WP theme hacking. comfortable enough with PHP and Javascript to move things around, but not enough to write them from scratch.) Thanks!

    Read the article

  • Retrieve value from form

    - by vetri
    My form is like <form action="javascript:;" method="post" id="reportForm"> <input type="text" name="as" maxlength="3" /> --CODE-- <html:hidden property="reportid" value="${Scope.reportId}" /> --code-- </form> I can retrieve values from the form in javascript like this.form = dojo.byId('reportForm'); this.as1 = this.form.as; How can i retrieve the value of the html:hidden tag property.

    Read the article

  • iphone uiwebview / form

    - by user290031
    Hey All, Okay, so I have an iphone app that presents the user with a UIWebview of an html page with a form I created. The form has standard stuff like a message box and dropdown boxes. Once the user fills out the form and clicks submit, it saves the information as nsstrings in my program. Okay, no problem there. That all works fine. However, I also wanna be able to edit this form as well. Once I save all this information the user selected in the form (as strings), is there a way to put it back into an html form using an uiwebview so a user of the app can edit the info later on?? I apologize in advance if I didn't give enough info.

    Read the article

  • how to do server side form validation for dynamic inputs with Django

    - by Satoru.Logic
    Hi, all. I am using django.forms.Form to validate form data in a survey applications. In a survey-creating form, a user can submit multiple questions that belong to the survey being created. Names for the question inputs are in the form of 'question_seq' , where seq is maintained using Javascript. Back in the server side, my code doesn't know before hand how many such questions will be submitted. Is there any way to do this with Django form so that the form can automatically recognizes the questions and validate them?

    Read the article

  • How is the C++ synthesized move constructor affected by volatile and virtual members?

    - by user1827766
    Look at the following code: struct node { node(); //node(const node&); //#1 //node(node&&); //#2 virtual //#3 ~node (); node* volatile //#4 next; }; main() { node m(node()); //#5 node n=node(); //#6 } When compiled with gcc-4.6.1 it produces the following error: g++ -g --std=c++0x -c -o node.o node.cc node.cc: In constructor node::node(node&&): node.cc:3:8: error: expression node::next has side-effects node.cc: In function int main(): node.cc:18:14: note: synthesized method node::node(node&&) first required here As I understand the compiler fails to create default move or copy constructor on line #6, if I uncomment either line #1 or #2 it compiles fine, that is clear. The code compiles fine without c++0x option, so the error is related to default move constructor. However, what in the node class prevents default move constructor to be created? If I comment any of the lines #3 or #4 (i.e. make the destructor non-virtual or make data member non-volatile) it compiles again, so is it the combination of these two makes it not to compile? Another puzzle, line #5 does not cause an compilation error, what is different from line #6? Is it all specific for gcc? or gcc-4.6.1?

    Read the article

  • Delphi - form within form

    - by mawg
    For aesthetic reasons, I want to show a form on top of another form, just as if it were a component, say like a TPanel. It should resize with the parent, move around as th eparent is drageed by its title bar, etc. ----------------------------- | main form component 1 | ----------------------------- | main | the 'embedded' | | form | form goes here | |comp 2| | ----------------------------- can I do that? If so how?

    Read the article

  • Recover Lost Form Data in Firefox

    - by Asian Angel
    Have you ever filled in a text area or form in a webpage and something happens before you can finish it? If you like the idea of recovering that lost data then you will want to have a look at the Lazarus: Form Recovery extension for Firefox. Lazarus: Form Recovery in Action For our first example we chose the comment text box area for one of the articles here at the website. As you can see we were not finished typing in the whole comment yet… Notice the “Lazarus Icon” in the lower right corner. Note: We simulated accidental tab closures for our two examples. After getting our webpage opened up again all of our text was gone. Right clicking within the text area showed two options available…”Recover Text & Recover Form”. Notice that our lost text was listed as a “sub menu”…this could be extremely useful in matching up the appropriate text to the correct webpage if you had multiple tabs open before something happened. Click on the correct text listing to insert it. So easy to finish writing our comment without having to start from zero again. In our second example we chose the sign-up form page for the website. As before we were not finished filling in the form… Getting the webpage opened back up showed the same problem as before…all the entered text was lost. This time we right clicked in the browser window area and there was that wonderful “Recover Form Command” waiting to be used. One click and… All of our lost form data was back and we were able to finish filling in the form. For those who may be interested you can disable Lazarus: Form Recovery on individual websites using the “Context Menu” for the “Status Bar Icon” Options There are three sections in the options and you should take a quick look through them to make any desired modifications in how Lazarus: Form Recovery functions. The first “Options Area” focuses on display/access for the extension. The second “Options Area” allows you to expand the type of data retained, enable removal of data within a given time frame, set up a password, disable search indexing, and enable form data retention while in “Private Browsing Mode”. The third “Options Area” focuses on the Lazarus database itself. Conclusion If you have ever lost text area or form data before then you know how much time could be lost in starting over. Lazarus: Form Recovery helps provide a nice backup solution to get you up and running once again with a minimum of effort. Links Download the Lazarus: Form Recovery extension (Mozilla Add-ons) Download the Lazarus: Form Recovery extension (Extension Homepage) Similar Articles Productive Geek Tips Quick Tip: Resize Any Textbox or Textarea in FirefoxWhy Doesn’t AutoComplete Always Work in Firefox?Pass Variables between Windows Forms Windows without ShowDialog()Using Secure Login in FirefoxAdd Search Forms to the Firefox Search Bar TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips DVDFab 6 Revo Uninstaller Pro Registry Mechanic 9 for Windows PC Tools Internet Security Suite 2010 Looking for Good Windows Media Player 12 Plug-ins? Find Out the Celebrity You Resemble With FaceDouble Whoa ! Use Printflush to Solve Printing Problems Icelandic Volcano Webcams Open Multiple Links At One Go

    Read the article

  • Respect regular onsubmit handlers from jQuery.submit

    - by orip
    I want a jQuery form submit handler to respect any previous submit handlers, including ones added with onsubmit. I'm trying to detect the previous handler's return value but can't seem to do it: <form><input type="submit" /></form> <script type="text/javascript"> $('form')[0].onsubmit = function() { return false; }; // called first $('form').submit(function(e) { console.log(e.result); // undefined console.log(e.isDefaultPrevented()); // false console.log(e.isPropagationStopped()); // false console.log(e.isImmediatePropagationStopped()); // false }); </script> Is there a way to do this?

    Read the article

  • sorting dynamic table created by form inputs [migrated]

    - by mille
    i am having problems with sorting can someone help to sort this table not just by its form entry id but onclick with some other columns i tried a lot of plugins but cant get anything to work and i dont know what to do i am new at this i sorry for my english thanks. here is the js: var Animals ={ index: window.localStorage.getItem("Animals:index"), $table: document.getElementById("animals-table"), $form: document.getElementById("animals-form"), $button_save: document.getElementById("animals-save"), $button_discard: document.getElementById("animals-discard"), init: function() { if (!Animals.index) { window.localStorage.setItem("Animals:index", Animals.index = 1); } Animals.$form.reset(); Animals.$button_discard.addEventListener("click", function(event) { Animals.$form.reset(); Animals.$form.id_entry.value = 0; }, true); Animals.$form.addEventListener("submit", function(event) { var entry = { id: parseInt(this.id_entry.value), animal_id:this.animal_id.value, animal_name: this.animal_name.value, animal_type: this.animal_type.value, bday: this.bday.value, animal_sex: this.animal_sex.value, mother_name: this.mother_name.value, farm_name: this.farm_name.value, money: this.money.value, weight: this.weight.value, purchase_partner: this.purchase_partner.value }; if (entry.id === 0) { Animals.storeAdd(entry); Animals.tableAdd(entry); } else { // edit Animals.storeEdit(entry); Animals.tableEdit(entry); } this.reset(); this.id_entry.value = 0; event.preventDefault(); }, true); if (window.localStorage.length - 1) { var animals_list = [], i, key; for (i = 0; i < window.localStorage.length; i++) { key = window.localStorage.key(i); if (/Animals:\d+/.test(key)) { animals_list.push(JSON.parse(window.localStorage.getItem(key))); } } if (animals_list.length) { animals_list.sort(function(a, b) {return a.id < b.id ? -1 : (a.id > b.id ? 1 : 0);}) .forEach(Animals.tableAdd);} Animals.$table.addEventListener("click", function(event) { var op = event.target.getAttribute("data-op"); if (/edit|remove/.test(op)) { var entry = JSON.parse(window.localStorage.getItem("Animals:"+ event.target.getAttribute("data- id"))); if (op == "edit") { Animals.$form.id_entry.value = entry.id; Animals.$form.animal_id.value = entry.animal_id; Animals.$form.animal_name.value = entry.animal_name; Animals.$form.animal_type.value = entry.animal_type; Animals.$form.bday.value = entry.bday; Animals.$form.animal_sex.value = entry.animal_sex; Animals.$form.mother_name.value = entry.mother_name; Animals.$form.farm_name.value = entry.farm_name; Animals.$form.money.value = entry.money; Animals.$form.weight.value = entry.weight; Animals.$form.purchase_partner.value = entry.purchase_partner; } else if (op == "remove") { if (confirm('Are you sure you want to remove this animal from your list?' )) { Animals.storeRemove(entry); Animals.tableRemove(entry); } } event.preventDefault(); } }, true); }, storeAdd: function(entry) { entry.id = Animals.index; window.localStorage.setItem("Animals:index", ++Animals.index); window.localStorage.setItem("Animals:"+ entry.id, JSON.stringify(entry)); }, storeEdit: function(entry) { window.localStorage.setItem("Animals:"+ entry.id, JSON.stringify(entry)); }, storeRemove: function(entry) { window.localStorage.removeItem("Animals:"+ entry.id); }, tableAdd: function(entry) { var $tr = document.createElement("tr"), $td, key; for (key in entry) { if (entry.hasOwnProperty(key)) { $td = document.createElement("td"); $td.appendChild(document.createTextNode(entry[key])); $tr.appendChild($td); } } $td = document.createElement("td"); $td.innerHTML = '<a data-op="edit" data-id="'+ entry.id +'">Edit</a> | <a data-op="remove" data-id="'+ entry.id +'">Remove</a>'; $tr.appendChild($td); $tr.setAttribute("id", "entry-"+ entry.id); Animals.$table.appendChild($tr); }, tableEdit: function(entry) { var $tr = document.getElementById("entry-"+ entry.id), $td, key; $tr.innerHTML = ""; for (key in entry) { if (entry.hasOwnProperty(key)) { $td = document.createElement("td"); $td.appendChild(document.createTextNode(entry[key])); $tr.appendChild($td); } } $td = document.createElement("td"); $td.innerHTML = '<a data-op="edit" data-id="'+ entry.id +'">Edit</a> | <a data-op="remove" data-id="'+ entry.id +'">Remove</a>'; $tr.appendChild($td); }, tableRemove: function(entry) { Animals.$table.removeChild(document.getElementById("entry-"+ entry.id)); } }; Animals.init();

    Read the article

  • search form in html/php via ajax

    - by fusion
    i've a search form wherein the database query has been coded in php and the html file calls this php file via ajax to display the results in the search form. the problem is, i would like the result to be displayed in the same form as search.html; yet while the ajax works, it goes to search.php to display the results. search.html: <!DOCTYPE html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script src="scripts/search_ajax.js" type="text/javascript"></script> </head> <body> <form id="submitForm" method="post"> <div class="wrapper"> <div class="field"> <input name="search" id="search" /> </div><br /> <input id="button1" type="submit" value="Submit" class="submit" onclick="run_query();" /><br /> </div> <div id="searchContainer"> </div> </form> </body> </html> if i add action="search.php" to the form tag, it displays the result but on search.php. i'd like it to display on the same form [i.e search.html, and not search.php] if i just add the javascript function [as done above], it displays nothing on search.html

    Read the article

  • JQuery .submit function will not submit form in IE

    - by Sean
    I have a form that submits some values to JQuery code,which then which sends off an email with the values from the form.It works perfectly in Firefox, but does not work in IE6(surprise!) or IE7. Has anyone any suggestions why? greatly appreciated?I saw on some blogs that it may have something to do with the submit button in my form but nothing Ive tried seems to work. Here is the form html: <form id="myform1"> <input type="hidden" name="itempoints" id="itempoints" value="200"> </input> <input type="hidden" name="itemname" id="itemname" value="testaccount"> </input> <div class="username"> Nickname: <input name="nickname" type="text" id="nickname" /> </div> <div class="email"> Email: <input name="email" type="text" id="email" /> </div> <div class="submitit"> <input type="submit" value="Submit" class="submit" id="submit" /> </div> </form> and here is my JQuery: var $j = jQuery; $j("form[id^='myForm']").submit(function(event) { var nickname = this.nickname.value; var itempoints = this.itempoints.value; var itemname = this.itemname.value; event.preventDefault(); var email = this.email.value; var resp = $j.ajax({ type:'post', url:'/common/mail/application.aspx', async: true, data: 'email=' +email + '&nickname=' + nickname + '&itempoints=' + itempoints + '&itemname=' + itemname, success: function(data, textStatus, XMLHttpRequest) { alert("Your mail has been sent!"); window.closepopup(); } }).responseText; return false; });

    Read the article

  • HTML button to NOT submit form

    - by arik-so
    Hello, I have a form. Outside that form, I have a button. A simple button, like this: <button>My Button</button> Nevertheless, when I click it, it submits the form. Here's the code: <form id="myform"> <input /> </form> <button>My Button</button> All this button should do is some JavaScript. But even when it looks just like in the code above, it submits the form. When I change the tag button to span, it works perfectly. But unfortunately, it needs to be a button. Is there any way to block that button from submitting the form? Like e. g. <button onclick="document.getElementById('myform').doNotSubmit();">My Button</button> Thanks in advance!

    Read the article

  • drupal form textfield #default_value not working

    - by alvin.ng
    I am working on a custom module with multi-page form on drupal 6. I found that #default_value is not working when my '#type' = 'textfield'. However, when '#type'='textarea', it displays correctly with the '#default_value' specified. Basically, I wrote a FormFactory to return different form definition ($form) based on the post parameter received. Initially, it returns the display of directories list, user then selects from radio buttos until a specific directory contains a xml file, it will become edit form. The edit form will have text fields display the data (#default_value) inside the xml file, however the type 'textarea' works here rather than 'textfield'. How can I make my '#default_value' work in this case? Below is the non-working field definition: $form['pageset']['newsTitle'] = array( '#type' => 'textfield', '#title' => 'News Title', '#default_value' => "{$element->newsTitle}", '#rows' => 1, '#required' => TRUE, ); Then I changed it to textarea as shown below to make it work: $form['pageset']['newsTitle'] = array( '#type' => 'textarea', '#title' => 'News Title', '#default_value' => "{$element->newsTitle}", '#rows' => 1, '#required' => TRUE, );

    Read the article

  • XPath query to get node after some other node

    - by czesio
    I am using "HtmlAgilityPack" to parse HTML content. My target is to get number value. <div> some content 1 <br> some <b>content</b> 2 <br> <b>NUMBER:</b> 9788492688647 <br> some content 3 <br> some content 4 </div> aim: - get "9788492688647" Anybody can tell me how to get value between /div/b[2] and <br> ?

    Read the article

  • search form in php via ajax

    - by fusion
    i've a search form wherein the database query has been coded in php and the html file calls this php file via ajax to display the results in the search form. the problem is, i would like the result to be displayed in the same form as search.html; yet while the ajax works, it goes to search.php to display the results. search.html: <!DOCTYPE html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script src="scripts/search_ajax.js" type="text/javascript"></script> </head> <body> <form id="submitForm" method="post"> <div class="wrapper"> <div class="field"> <input name="search" id="search" /> </div><br /> <input id="button1" type="submit" value="Submit" class="submit" onclick="run_query();" /><br /> </div> <div id="searchContainer"> </div> </form> </body> </html> if i add action="search.php" to the form tag, it displays the result but on search.php. i'd like it to display on the same form [i.e search.html, and not search.php] if i just add the javascript function [as done above], it displays nothing on search.html

    Read the article

  • Help with PHP simplehtmldom - Modifiying a form.

    - by onemyndseye
    Ive gotten some great help here and I am so close to solving my problem that I can taste it. But I seem to be stuck. I need to scrape a simple form from a local webserver and only return the lines that match a users local email (i.e. onemyndseye@localhost). simplehtmldom makes easy work of extracting the correct form element: foreach($html->find('form[action*="delete"]') as $form) echo $form; Returns: <form action="/delete" method="post"> <input type="checkbox" id="D1" name="D1" /><a href="http://www.linux.com/rss/feeds.php"> http://www.linux.com/rss/feeds.php </a> [email: onemyndseye@localhost (Default) ]<br /> <input type="checkbox" id="D2" name="D2" /><a href="http://www.ubuntu.com/rss.xml"> http://www.ubuntu.com/rss.xml </a> [email: onemyndseye@localhost (Default) ]<br /> However I am having trouble making the next step. Which is returning lines that contain 'onemyndseye@localhost' and removing it so that only the following is returned: <input type="checkbox" id="D1" name="D1" /><a href="http://www.linux.com/rss/feeds.php">http://www.linux.com/rss/feeds.php</a> <br /> <input type="checkbox" id="D2" name="D2" /><a href="http://www.ubuntu.com/rss.xml">http://www.ubuntu.com/rss.xml</a> <br /> Thanks to the wonderful users of this site Ive gotten this far and can even return just the links but I am having trouble getting the rest... Its important that the complete <input> tags are returned EXACTLY as shown above as the id and name values will need to be passed back to the original form in post data later on. Thanks in advance!

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >