Search Results

Search found 5274 results on 211 pages for 'submit'.

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

  • Same jQuery code returns two different results – Submit Button Text

    - by Lijo
    I have two jQuery codes - http://jsfiddle.net/Lijo/CXGX7/7/ and http://jsfiddle.net/Lijo/CXGX7/8/ . The first code returns undefined whereas the second code returns text of button. QUESTIONS What is the reason for this difference in result? Why is the first code not returning expected text of button? Note: I verified that both are using same version of jQuery (by an alert of jQuery) alert($.fn.jquery); CODE <html xmlns="http://www.w3.org/1999/xhtml"> <head><title> </title> <script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.8.1.js"></script> <script type="text/javascript"> alert($('.myButton').attr("value")); </script> </head> <body> <form method="post" action="Test.aspx" id="form1"> <div class="aspNetHidden"> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTE0MDM4MzYxMjNkZMycQvsYQ+GPFsQHoQ8j/8vEo2vQbqkhfgPc60kxXaQO" /> </div> <div class="aspNetHidden"> <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWAwKqxqqrCgLi/JazDQKM54rGBqgaroRQTXJkD1LyUlVxAmLRCNfTGVe73swQBMemBtvN" /> </div> <div> <input name="txtEmpName" type="text" id="txtEmpName" /> <input type="submit" name="Button1" value="Submit" id="Button1" class="myButton" /> </div> </form> </body> </html> REFERENCES Retrieve Button value with jQuery How to determine and print jQuery version?

    Read the article

  • Should I Use Anchor, Button Or Form Submit For "Follow" Feature In Rails

    - by James
    I am developing an application in Rails 3 using a nosql database. I am trying to add a "Follow" feature similar to twitter or github. In terms of markup, I have determined that there are three ways to do this. 1) Use a regular anchor. (Github Uses This Method) <a href="/users/follow?target=Joe">Follow</a> 2) Use a button. (Twitter Uses This Method) <button href="/friendships/create/">Follow</button> 3) Use a form with a submit button. (Has some advantages for me, but I haven't see anyone do it yet.) <form method="post" id="connection_new" class="connection_new" action="/users/follow"> <input type="hidden" value="60d7b563355243796dd8496e17d36329" name="target" id="target"> <input type="submit" value="Follow" name="commit" id="connection_submit"> </form> Since I want to store the user_id in the database and not the username, options 1 and 2 will force me to do a database query to get the actual user_id, whereas option 3 will allow me to store the user_id in a hidden form field so that I don't have to do any database lookups. I can just get the id from the params hash on form submission. I have successfully got each of these methods working, but I would like to know what is the best way to do this. Which way is more semantic, secure, better for spiders, etc...? Is there a reason both twitter and github don't use forms to do this? Any guidance would be appreciated. I am leaning towards using the form method since then I don't have to query the db to get the id of the user, but I am worried that there must be a reason the big guys are just using anchors or buttons for this. I am a newb so go easy on me if I am totally missing something. Thanks!

    Read the article

  • Overriding form submit based on counting elements with jquery.each

    - by MrGrigg
    I am probably going about this all wrong, but here's what I'm trying to do: I have a form that has approximately 50 select boxes that are generated dynamically based on some database info. I do not have control over the IDs of the text boxes, but I can add a class to each of them. Before the form is submitted, the user needs to select at least one item from the select box, but no more than four. I'm a little bit sleepy, and I'm unfamiliar with jQuery overall, but I'm trying to override $("form").submit, and here's what I'm doing. Any advice or suggestions are greatly appreciated. $("form").submit(function() { $('.sportsCoachedValidation').each(function() { if ($('.sportsCoachedValidation :selected').text() != 'N/A') { sportsSelected++ } }); if (sportsSelected >= 1 && sportsSelected <= 4) { return true; } else if (sportsSelected > 4) { alert('You can only coach up to four sports.'); sportsSelected = 0; return false; } else { alert('Please select at least one coached sport.'); sportsSelected = 0; return false; } });

    Read the article

  • multiple form submission with one submit

    - by skylab
    I've been trying to think this through and figure out if it is possible or not. I'm using zen-cart as shopping cart software, but what I'd like to do, is hard code a page that is basically a list of 7-9 products, next to each product is a checkbox, so I'd like to figure out a way, via html,javascript or jquery to submit whichever forms(products) are checked to the cart. The typical form submission for a product looks something like this(sometimes there may be one or two additional hidden fields): <form name="cart_quantity" action="index.php?action=add_product" method="post" enctype="multipart/form-data"> <input type="hidden" name="cart_quantity" value="1"> <input type="hidden" name="products_id" value="7"> <input type="hidden" name="id[6]" value="9" id="attrib-6-9"> <input type="image" src="buy_button.png" alt="Add to Cart" title="Instructional Video Part 1: Add to Cart"> </form> There would be 7-9 of these on the page, each with a checkbox, so I'm assuming a script would need to figure out which ones where checked and submit them via the form action? Maybe there is a better way of going about this that I'm not thinking of because a)it's over my head or b)just haven't figured it out yet. Anyway is something like this possible?

    Read the article

  • retaining the form inputs on clicking the submit button

    - by sushant
    i have a form. the code is: <html> <body> <form method="post" action="array.asp"> <input type="text" name="Req_id1"> Req_id: <input type="text" name="Req_id"> <input type="submit" value="search" id=submit1 name=submit1> <select id="selFiles" name="selFiles" class="Select" style="width: 500px" tabindex="130"> <% Dim req_id,myArray(11) req_id=Request.Form("Req_id") myArray(0) = "FCC_CITI_LONDON\FCC_V.FM_Release_5.0" myArray(1) = "FCC_CITIUSDDA\FC_UBS_V.UM_10.3.0.0.CitiUSDDA1.0" myArray(2) = "FCC_KorAm\Flexcube_V.CK_Release_5.0" myArray(3) = "FCC-CL\FCC-CL.1.1.1" myArray(4) = "Mayaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" myArray(5) = "Juneaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" myArray(6) = "Julyaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" myArray(7) = "Augustaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" myArray(8) = "Septemberaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" myArray(9) = "Octoberaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" myArray(10) = "Novemberaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" myArray(11) = "Decemberaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" Dim myArrResult myArrResult = Filter(myArray, req_id, True, vbTextCompare) Dim item For Each item In myArrResult Response.Write("<option>" + item + "</option>") Next %> </select> </body> </html> in between the form there is an opption to search a string from the array. on clicking submit the result are shown in the drop-down box. but the problem is that i loose all the input entered in the form before. for ex:the first input box goes blank. how do i retain the previous inputs? any help is really appreciated.

    Read the article

  • submit in html on sql query

    - by user1644661
    i need to run this sql query , which give me a list of Id and Dates i want to click each result and take with me the Id value to the next form i wrote this query above but i see in the debager that the hidden ID get his value but not pass to the next form i think i have a problem with the submit() . where should i put him ? thanks anat function ShowAllCarts($user_email) { $connB = new ProductDAO(); $connB->Connect(); $pro_query = "SELECT * FROM Cart WHERE `Email`='$user_email';"; $db_result = $connB->ExecSQL($pro_query); $html_result = '<div data-role="content"> <ul data-role="listview" data-theme="b"> '; $html_result .= '<form action="PreviouscartProduct.php" method="POST"/>'; while($row_array = $db_result->fetch_array(MYSQLI_ASSOC)) { $Id= $row_array['Id']; $Date= $row_array['Date']; //$html_result // $html_result .="<li><a href='PreviouscartProduct.php'>Cart number: $Id from Date: $Date><input type='hidden' name='Id' value'<?=$Id?>'</input></a></li>'"; $html_result .= '<a onclick="this.form.submit();" </a>; } $html_result .= ' </ul> </div>'; $html_result .= '</form>'; $connB->Disconnect(); return $html_result; } //display all carts $func_result = ShowAllCarts($Email);

    Read the article

  • How to Submit Form Given Specific Json Response

    - by dentalhero
    I'm new to Json, so please excuse the newb question. I have a form in which I'm conducting an Ajax post to submit address information to a backend script for validation. Here's the form: <form name="Form" id="Forms" method="post" action="WebCatPageServer.exe" class="uniForm"> <input name="Action" type="hidden" value="SHIPTOVALIDATE"/> <input name="IsAjax" type="hidden" value="Yes"/> <!-- <input name="Action" type="hidden" value="VerifyOrder"/>--> <fieldset class="inlineLabels top"> <h2>Order Details</h2> <div class="ctrlHolder first"> <label for="orderdesc">Order Description</label> <input name="Order Desc" id="OrderDesc" type="text" class="textInput small" tabindex="1" value=""/> </div> <div class="ctrlHolder"> <label for="po">PO # <span class="redasterisk">*</span></label> <input name="Cust Po" id="PoJobNo" type="text" class="textInput small required" maxlength="20" tabindex="2" value="dgnfg"/> </div> <!-- <div class="ctrlHolder"> <label for="jobname">Job Name</label> <input name="Job Name" id="CustJobName" type="text" class="textInput small" maxlength="15" tabindex="3" value=""/> </div> --> <div class="ctrlHolder"> <label for="shipvia">Ship Via <span class="redasterisk">*</span></label> <select name="Ship Via" id="shipvia" class="selectInput small required" tabindex="4"/> <option value="" class="default">Select Ship Method</option> <option value="OT - Our Truck" class="del" selected>Our Truck</option> <option value="WC - Will Call" class="pick">Will Call</option> </select> </div> <div class="ctrlHolder" id="pickupdate"> <label for="datepickup">Requested Pickup Date <span class="redasterisk">*</span></label> <input name="datepickup" id="datepickup" type="text" class="textInput small" tabindex="5" value="11/09/2012"> </div> <div class="ctrlHolder" id="shipdate"> <label for="dateship">Requested Delivery Date <span class="redasterisk">*</span></label> <input name="dateship" id="dateship" type="text" class="textInput small" value="" tabindex="6"> </div> <div class="ctrlHolder" id="shipto"> <label for="ShipTo">Ship To <span class="redasterisk">*</span></label> <select name="ShipTos" id="ShipTos" class="selectInput auto required" tabindex="7"> <option value="">Select an Option</option> <option value="ShipToManual" class="manual">Manually Enter Address</option> <option value="0">A ACTION AIR*, 5241 YANCEYVILLE, COLUMBIA, SC 29214-0001</option> <option value="1">A ACTION AIR*, 649 spring lane, sanford, NC 27330</option> <option value="2">A ACTION AIR*, 1313 south briggs avenue, durham, NC 27703</option> <option value="3">A ACTION AIR*, 112 cricket hill lane, cary, NC 27513</option> <option value="4">A ACTION AIR*, 2911 duke homestead road, durham, NC 27705</option> <option value="5">A ACTION AIR*, chickem poop, atlanta, GA 60609</option> </select> <br /> </div> </fieldset> <fieldset class="inlineLabels" id="shipinfo"> <h2>Shipping Information</h2> <div class="ctrlHolder first"> <label for="YourName">Your Name <span class="redasterisk">*</span></label> <input name="Your Name" id="Your_Name" type="text" class="textInput small required" tabindex="8" value="" /> </div> <div class="ctrlHolder"> <label for="CompanyName">Company Name <span class="redasterisk">*</span></label> <input name="Company Name" id="CompanyName" type="text" class="textInput small required" tabindex="9" value="A ACTION AIR*"/> </div> <div class="ctrlHolder"> <label for="Address1">Address 1 <span class="redasterisk">*</span></label> <input name="Address_1" id="Address_1" type="text" maxlength="30" class="textInput small required" tabindex="10" value="5241 YANCEYVILLE"/> </div> <div class="ctrlHolder"> <label for="Address2">Address 2</label> <input name="Address_2" id="Address_2" type="text" maxlength="30" class="textInput small" tabindex="11" value=""/> </div> <div class="ctrlHolder"> <label for="City">City <span class="redasterisk">*</span></label> <input name="City" id="City" type="text" maxlength="25" class="textInput small required" tabindex="12" value="COLUMBIA"/> </div> <div class="ctrlHolder"> <label for="State">State <span class="redasterisk">*</span></label> <select name="State" id="State" class="selectInput small required" tabindex="13"> <option value="">Select State</option> <option value="AL">Alabama</option> <option value="AK">Alaska</option> <option value="AZ">Arizona</option> <option value="AR">Arkansas</option> <option value="CA">California</option> <option value="CO">Colorado</option> <option value="CT">Connecticut</option> <option value="DE">Delaware</option> <option value="FL">Florida</option> <option value="GA">Georgia</option> <option value="HI">Hawaii</option> <option value="ID">Idaho</option> <option value="IL">Illinois</option> <option value="IN">Indiana</option> <option value="IA">Iowa</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> <option value="LA">Louisiana</option> <option value="ME">Maine</option> <option value="MD">Maryland</option> <option value="MA">Massachussetts</option> <option value="MI">Michigan</option> <option value="MN">Minnesota</option> <option value="MS">Mississippi</option> <option value="MO">Missouri</option> <option value="MT">Montana</option> <option value="NE">Nebraska</option> <option value="NV">Nevada</option> <option value="NH">New Hampshire</option> <option value="NJ">New Jersey</option> <option value="NM">New Mexico</option> <option value="NY">New York</option> <option value="NC">North Carolina</option> <option value="ND">North Dakota</option> <option value="OH">Ohio</option> <option value="OK">Oklahoma</option> <option value="OR">Oregon</option> <option value="PA">Pennsylvania</option> <option value="RI">Rhode Island</option> <option value="SC" selected>South Carolina</option> <option value="SD">South Dakota</option> <option value="TN">Tennessee</option> <option value="TX">Texas</option> <option value="UT">Utah</option> <option value="VT">Vermont</option> <option value="VA">Virginia</option> <option value="WA">Washington</option> <option value="WV">West Virginia</option> <option value="WI">Wisconsin</option> <option value="WY">Wyoming</option> </select> </div> <div class="ctrlHolder"> <label for="ZipCode">Zip Code <span class="redasterisk">*</span></label> <input name="Zip" id="Zip" type="text" maxlength="10" class="textInput small required zipcode" tabindex="14" value=""/> </div> <div class="ctrlHolder"> <label for="Phone">Phone <span class="redasterisk">*</span></label> <input name="Phone Number" id="Phone" type="text" class="textInput small required phone" alt="phone-us" tabindex="15" value="(336)954-5009"/> </div> <div class="ctrlHolder"> <label for="Fax">Fax</label> <input name="FaxNumber" id="Fax Number" type="text" class="textInput small fax" alt="phone-us" tabindex="16" value=""/> </div> <div class="ctrlHolder"> <label for="">E-mail <span class="redasterisk">*</span></label> <input name="Email" id="Email" type="text" class="textInput small required email" tabindex="17" value=""/> </div> </fieldset> <fieldset class="inlineLabels"> <h2>Order/Shipping Notes</h2> <div class="ctrlHolder first"> <label for="notes">Order Notes </label> <textarea name="OrderNotes" id="ta" cols="26" rows="7" tabindex="18"></textarea><br /> <p class="formHint"><b>(Maximum characters: 175) &nbsp; <span id="charLeft"></span> &nbsp; Characters left</b><br /> (Cross streets, special instructions, etc.)</p> <br /> </div> </fieldset> <fieldset class="inlineLabels"> <h2>Continue To Next Step</h2> <div class="buttonHolder"> <label for="freightmsg">**Applicable freight charges will be applied at the time of invoicing.**</label> <input name="continuetocheckout" type="submit" class="button red smallrounded" value="Continue &gt;" alt="Continue to Next Step" tabindex="20"/> </div> </fieldset> </form> AJAX Call Here's the AJAX call: $(function() { $("#Forms").submit(function() { $.ajax({ type: 'post', url: 'WebCatPageServer.exe', dataType : 'json', data: $("#Forms").serialize(), complete:function(data){ alert(data); } }); return false; }); }); JSON Response Here's the JSON response: {"DidValidate":true,"Company Name":"A ACTION AIR*","AddrLine1":"5241 YANCEYVILLE","AddrLine2":"","City":"COLUMBIA","State":"SC","Zip":"","Modified":false,"AddressError":false,"ZipError":false} Question: How do I submit the form programatically if both AddressError and ZipError return with a false?

    Read the article

  • close colorbox iframe after submit

    - by I Like PHP
    i m using jqury colorbox to show a shopping cart item, i want that wehen user enter the quantity in that i frame and click on submit button, that i frame closed and main window(parent) is refresh automatically.... i means i want two things after submiitting data on i frame 1. autoclose i frame 2.refresh parent window please help me out

    Read the article

  • PyQt QDataWidgetMapper submit doesn't work

    - by DSblizzard
    Here is the parts of code (Mw - main window, Ed - edit dialog, Tv - table view): Mw.mapper = QDataWidgetMapper(Mw) Mw.mapper.setSubmitPolicy(QDataWidgetMapper.ManualSubmit) Mw.mapper.setItemDelegate( QSqlRelationalDelegate(Mw.mapper) ) Mw.mapper.setModel(Table.Model) # Id - first invisible key column Mw.mapper.addMapping(Ed.leName, Name) # Name == 1 Mw.mapper.addMapping(Ed.leSize, Size) # Size == 2 Mw.mapper.toFirst() Row = Tv.currentIndex().row() Mw.mapper.setCurrentIndex(Row) Ed.setModal(1) Ed.show() Res = Mw.mapper.submit() # False Table.Model.submitAll() SQL UPDATE statement works in this case. Why problem with mapper?

    Read the article

  • IE 8 Compatibility Mode Causes Form Submit Button to Wrap

    - by Robert
    The below code does what I want in browsers I check with except IE when using compatibility mode. In compatibility mode the submit (Remove) button wraps to the next line. Can anyone help? It should look like it does in Firefox or IE when not using compatibility mode. Can't use float:left/right because I cannot specify length beforehand. Thanks for any help. Name: Test Name That is Longer Than The Other Qty: 1 Name: Short Test Name Qty: 1

    Read the article

  • Submit by pressing enter in a windows form

    - by Avik
    In order to transfer text from one textbox to another, I have created a submit button. However it would be preferable to use the functionality of the 'enter' key. I am not sure but i think the ascii code is 13.Anyway how do I go about this task at hand?

    Read the article

  • How to submit a form automatically using HttpWebResponse

    I am looking for an application that can do the following a) Programmatically auto login to a page(login.asxp) using HttpWebResponse by using already specified username and password. b) Detect the redirect URL if the login is successful. c) Submit another form (settings.aspx) to update certain fields in the database. The required coding needs to be using asp.net The application needs to complete this entire process in the same session cookie.

    Read the article

  • PHP & MySQL submit error message problem

    - by peakUC
    When I submit a new name and not a new avatar I get the following avatar error message Please upload a .gif, .jpeg, .jpg or .png image!. I want to be able to send a new name only without having to upload a new avatar each time I submit the form without getting the avatar error message Please upload a .gif, .jpeg, .jpg or .png image! can someone help me fix this problem? Here is the php code. if (isset($_POST['submitted'])) { $mysqli = mysqli_connect("localhost", "root", "", "sitename"); $dbc = mysqli_query($mysqli,"SELECT users.* FROM users WHERE user_id=3"); $first_name = mysqli_real_escape_string($mysqli, htmlentities(strip_tags($_POST['first_name']))); $user_id = '3'; if(isset($_FILES["avatar"]["name"]) && $_FILES['avatar']['size'] <= 5242880) { if($_FILES["avatar"]["type"] == "image/gif" || $_FILES["avatar"]["type"] == "image/jpeg" || $_FILES["avatar"]["type"] == "image/jpg" || $_FILES["avatar"]["type"] == "image/png" || $_FILES["avatar"]["type"] == "image/pjpeg") { if (file_exists("../members/" . $user_id . "/images/" . $_FILES["avatar"]["name"])) { echo '<p class="error">' . mysqli_real_escape_string($mysqli, htmlentities(strip_tags(basename($_FILES["avatar"]["name"])))) . ' already exists! '; } else if($_FILES["avatar"]["name"] == TRUE) { move_uploaded_file($_FILES["avatar"]["tmp_name"], "../members/" . $user_id . "/images/" . mysqli_real_escape_string($mysqli, htmlentities(strip_tags(basename($_FILES["avatar"]["name"]))))); $avatar = mysqli_real_escape_string($mysqli, htmlentities(strip_tags(basename($_FILES["avatar"]["name"])))); } } else if($_FILES["avatar"]["type"] != "image/gif" || $_FILES["avatar"]["type"] != "image/jpeg" || $_FILES["avatar"]["type"] != "image/jpg" || $_FILES["avatar"]["type"] != "image/png" || $_FILES["avatar"]["type"] != "image/pjpeg") { echo '<p class="error">Please upload a .gif, .jpeg, .jpg or .png image!</p>'; } } else if($_FILES['avatar']['size'] >= 5242880) { echo '<p class="error">Please upload a smaller pic!</p>'; } else if($_FILES["avatar"]["name"] == NULL) { $avatar = NULL; } if(isset($_FILES["avatar"]["name"]) && $_FILES['avatar']['size'] <= 5242880) { if (mysqli_num_rows($dbc) == 0) { $mysqli = mysqli_connect("localhost", "root", "", "sitename"); $dbc = mysqli_query($mysqli,"INSERT INTO users (user_id, first_name, avatar) VALUES ('$user_id', '$first_name', '$avatar')"); } if ($dbc == TRUE) { $dbc = mysqli_query($mysqli,"UPDATE users SET first_name = '$first_name', avatar = '$avatar' WHERE user_id = '$user_id'"); echo '<p class="changes-saved">Your changes have been saved!</p>'; } if (!$dbc) { print mysqli_error($mysqli); return; } } }

    Read the article

  • update div after jeditable submit in rails

    - by nvano
    i want to submit the text from jeditable, store it in the database and then i don´t want to render the updated text back to jeditable field, i want to update the whole div in which the jeditable field (and maybee other text fields) is. f.e. i change the username via jeditable inplace editor, then i store the changes in the db and now i want to update the complete div which contains the username (in place editor) and also other divs, cause after the username changes, the email changes, too.

    Read the article

  • how can I get data in the table cell that is checked after submit

    - by arnold
    can someone give me help, please. here's my basic html <form action="addSomething.php" method="POST"> <table> <tr> <th>Add Data</th> <th>Description</th> <th>Quantity</th> </tr> <tr> <td><input type="checkbox" name="data[]" value="sample1" /> </td> <td class="desc">Newbie</td> <td>2</td> </tr> <tr> <td><input type="checkbox" name="data[]" value="sample1" /> </td> <td class="desc">Pro</td> <td>1</td> </tr> <tr> <td><input type="checkbox" name="data[]" value="sample1"/> </td> <td class="desc" > Master </td> <td>1</td> </tr> <br/> <input type="submit" name="add" value="SUBMIT"/> ..... how can I get the one with the class "desc" and the column for quantity that is checked after submitting the form because the only I can add when querying in mysql is the value of checkbox but I want also the value of the data in "Description" column and "Quantity" column In my addSomething.php the code I have is if(isset($_POST['add'])) { foreach($_POST['data'] as $value) { $sql = "INSERT INTO tablename (column1) VALUES('$value');" //query stuff } } what I will do , Any hints guys?

    Read the article

  • Extjs Form Action Submit - Custom override?

    - by Scott
    Looking at the source code of Action.Submit, I'm trying to figure out where ext is appending the form's fields to the parameters. Instead of sending each field as a separate parameter, I want to send something like: formObj:{field1:value, field2:value} Currently, each of those values are simply added to the parameter list along with any custom/baseParams. Where are these formfields being added so that I can change this behaviour? Thanks.

    Read the article

  • iPhone Development: Use POST to submit a form

    - by Mario
    I've got the following html form: <form method="post" action="http://shk.ecomd.de/up.php" enctype="multipart/form-data"> <input type="hidden" name="id" value="12345" /> <input type="file" name="pic" /> <input type="submit" /> </form> And the following iPhone SDK Submit method: - (void)sendfile { UIImage *tempImage = [UIImage imageNamed:@"image.jpg"]; NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init]; [request setHTTPMethod:@"POST"]; [request setURL:[NSURL URLWithString:@"http://url..../form.php"]]; NSString *boundary = @"------------0xKhTmLbOuNdArY"; NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@",boundary]; [request addValue:contentType forHTTPHeaderField: @"Content-Type"]; NSMutableData *body = [NSMutableData data]; [body appendData:[[NSString stringWithFormat:@"\r\n%@\r\n",boundary] dataUsingEncoding:NSASCIIStringEncoding]]; [body appendData:[@"Content-Disposition: form-data; name=\"id\"\r\n\r\n" dataUsingEncoding:NSASCIIStringEncoding]]; [body appendData:[@"12345" dataUsingEncoding:NSUTF8StringEncoding]]; [body appendData:[[NSString stringWithFormat:@"\r\n%@\r\n",boundary] dataUsingEncoding:NSASCIIStringEncoding]]; [body appendData:[@"Content-Disposition: form-data; name=\"pic\"; filename=\"photo.png\"\r\n" dataUsingEncoding:NSASCIIStringEncoding]]; [body appendData:[@"Content-Type: application/octet-stream\r\n\r\n" dataUsingEncoding:NSASCIIStringEncoding]]; [body appendData:[NSData dataWithData:UIImageJPEGRepresentation(tempImage, 90)]]; [body appendData:[[NSString stringWithFormat:@"\r\n%@",boundary] dataUsingEncoding:NSASCIIStringEncoding]]; // setting the body of the post to the reqeust [request setHTTPBody:body]; NSError *error; NSURLResponse *response; NSData* result = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; NSString* aStr = [[[NSString alloc] initWithData:result encoding:NSASCIIStringEncoding] autorelease]; NSLog(@"Result: %@", aStr); [request release]; } This does not work, but I have no clue why. Can you please help me?!! What am I doing wrong?

    Read the article

  • Form is trying to save the login value of the submit button to my DB.

    - by Sergio Tapia
    Here's my Zend code: <?php require_once ('Zend\Form.php'); class Sergio_Form_registrationform extends Zend_Form { public function init(){ /*********************USERNAME**********************/ $username = new Zend_Form_Element_Text('username'); $alnumValidator = new Zend_Validate_Alnum(); $username ->setRequired(true) ->setLabel('Username:') ->addFilter('StringToLower') ->addValidator('alnum') ->addValidator('regex', false, array('/^[a-z]+/')) ->addValidator('stringLength',false,array(6,20)); $this->addElement($username); /*********************EMAIL**********************/ $email = new Zend_Form_Element_Text('email'); $alnumValidator = new Zend_Validate_Alnum(); $email ->setRequired(true) ->setLabel('EMail:') ->addFilter('StringToLower') ->addValidator('alnum') ->addValidator('regex', false, array('/^[a-z]+/')) ->addValidator('stringLength',false,array(6,20)); $this->addElement($email); /*********************PASSWORD**********************/ $password = new Zend_Form_Element_Password('password'); $alnumValidator = new Zend_Validate_Alnum(); $password ->setRequired(true) ->setLabel('Password:') ->addFilter('StringToLower') ->addValidator('alnum') ->addValidator('regex', false, array('/^[a-z]+/')) ->addValidator('stringLength',false,array(6,20)); $this->addElement($password); /*********************NAME**********************/ $name = new Zend_Form_Element_Text('name'); $alnumValidator = new Zend_Validate_Alnum(); $name ->setRequired(true) ->setLabel('Name:') ->addFilter('StringToLower') ->addValidator('alnum') ->addValidator('regex', false, array('/^[a-z]+/')) ->addValidator('stringLength',false,array(6,20)); $this->addElement($name); /*********************LASTNAME**********************/ $lastname = new Zend_Form_Element_Text('lastname'); $alnumValidator = new Zend_Validate_Alnum(); $lastname ->setRequired(true) ->setLabel('Last Name:') ->addFilter('StringToLower') ->addValidator('alnum') ->addValidator('regex', false, array('/^[a-z]+/')) ->addValidator('stringLength',false,array(6,20)); $this->addElement($lastname); /*********************DATEOFBIRTH**********************/ $dateofbirth = new Zend_Form_Element_Text('dateofbirth'); $alnumValidator = new Zend_Validate_Alnum(); $dateofbirth->setRequired(true) ->setLabel('Date of Birth:') ->addFilter('StringToLower') ->addValidator('alnum') ->addValidator('regex', false, array('/^[a-z]+/')) ->addValidator('stringLength',false,array(6,20)); $this->addElement($dateofbirth); /*********************AVATAR**********************/ $avatar = new Zend_Form_Element_File('avatar'); $alnumValidator = new Zend_Validate_Alnum(); $avatar ->setRequired(true) ->setLabel('Please select a display picture:'); $this->addElement($avatar); /*********************SUBMIT**********************/ $this->addElement('submit', 'login', array('label' => 'Login')); } } ?> Here's the code I use to save the values: public function saveforminformationAction(){ $form = new Sergio_Form_registrationform(); $request = $this->getRequest(); //if($request->isPost() && $form->isValid($_POST)){ $data = $form->getValues(); $db = $this->_getParam('db'); $db->insert('user',$data); //} } When trying to save the values, I recieve a ghastly error: Column 'login' not found.

    Read the article

  • how to get all ListBox items on submit action

    - by Sefer KILIÇ
    how I get ALL ListBox values (not only selected items) on submit action in asp.net mvc2 project. I'm using Ajax forms like Ajax.BeginForm("actionname", new....) I already try to select all items on OnBegin event of Ajax options but still I havent got all ListBox items have any idea ? thanks

    Read the article

  • Submit form in PHP using Hit Enter

    - by Ajith
    I am using an image instead of a submit button for search option and use onclick events to load the results using ajax in php.Now I need to load results by hit enter also.Is their any ways to update my application without changing the image. Thanks

    Read the article

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