Search Results

Search found 6055 results on 243 pages for 'forms'.

Page 78/243 | < Previous Page | 74 75 76 77 78 79 80 81 82 83 84 85  | Next Page >

  • upload form only works in Firefox when uploading ASCII .stl 3D files

    - by NathanPDX
    uploadform.html and upload_file.php (below) works fine in Firefox but fails in Chrome, IE, and Safari when uploading ASCII .stl 3D files. Error message is "Invalid file" and problem occurs with multiple computers and multiple .stl files. When I modify the code to support other file types like JPG and PDF it allows those file types in all three web browsers. Also, Firefox only allows the .stl upload if I include application/octet-stream in the mime types section. Why doesn't this work outside of Firefox? uploadform.html: <!doctype html> <html> <body> <form action="upload_file.php" method="post" enctype="multipart/form-data"> <label for="file">Filename:</label> <input type="file" name="file" id="file" /> <br /> <input type="submit" name="submit" value="Submit" /> </form> </body> </html> upload_file.php: <!doctype html> <html> <body> <?php $allowedExts = array("stl"); $extension = end(explode(".", $_FILES["file"]["name"])); if ( ( ($_FILES["file"]["type"] == "application/sla") || ($_FILES["file"]["type"] == "application/octet-stream") || ($_FILES["file"]["type"] == "text/plain") || ($_FILES["file"]["type"] == "application/unknown") ) && ($_FILES["file"]["size"] < 2000000) && in_array($extension, $allowedExts) ) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br />"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br />"; echo "Size: " . ($_FILES["file"]["size"] /1024) . " KB<br />"; if (file_exists("upload/" . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $_FILES["file"]["name"]); echo "successful upload"; } } } else { echo "Invalid file"; } ?> </body> </html>

    Read the article

  • How best to make a link submit a form.

    - by nickf
    What's the best way to get a regular anchor (<a href="...">) to submit the form it is embedded in when clicked? <form> <ul> <li> <p> The link could be <span>embedded <a href="" onclick="?">at any level</a></span> in the form, so "this.parentNode.parentNode..." is no good. :( </p> </li> </ul> </form> I know that the easiest way using jQuery would be $('#myLink').click(function() { $(this).parents('form:first').submit(); }); ...but I'm trying to find a way to do this without using a library. Edit: I'm really trying to find a method which doesn't require knowledge of the form (eg: its name, id, etc). This would be similar to how you could put this on an input element: <input onclick="this.form.submit()" />

    Read the article

  • Any way to find out which line break char(s) to use in Javascript?

    - by Irro
    I'm trying to parse some text into a textarea control and at the same time replace all with ordinary line break chars. I have been able to do it in windows by replacing with CR (it didn't work with CRLF strangely enough, it gave me linebreak + empty space) but I'm afraid that this code won't work in Unix/Mac because they use LF for line break. Is there any way to use the system default line break char in javascript? Something similar to Environment.NewLine in .Net (I wasn't able to write backslash in this editor but I use /r for CR and /n for LF, replace / with backslash)

    Read the article

  • Retrieving multiple rows from a loop-created form... Stuck.

    - by hangston
    Let me start by saying that I'm new to PHP, but I'm here to learn and would really appreciate your help. I use the following code to pull in data and create a form. This creates up to 40 lines for a user to fill out. Each line consists of the same information: Description, Amount, and Frequency. The remainder of the information needed is generated by the database. (See hidden fields) <?php $row = 0; do { $optid = $row_options['option_id']; echo "<tr>\n\t<td>" . htmlentities($row_options['option']) . "</td>\n"; echo "\t<td>" . "<input name='description' type='text' size='40' maxlength='120'/>" . "</td>\n"; echo "\t<td>" . "<input name='option_id' type='hidden' value='$optid' />$<input name='amount' type='text' size='10' maxlength='7'/>" . "</td>\n"; echo "\t<td>" . "<select name='assisted_frequency'> <option value='Monthly'>Monthly</option> <option value='Weekly'>Weekly</option> <option value='Daily'>Daily</option> <option value='Hourly'>Hourly</option> <option value='One-Time'>One-Time</option> </select>" . "</td>\n</tr>\n"; $array[$row] = array( $arraydesc[$row] = $_POST['description'], $arrayamto[$row] = $_POST['amount'], $arrayoptid[$row] = $optid, $arrayfreq[$row] = $_POST['frequency'], ); $row ++; } while ($row_options = mysql_fetch_assoc($options)); $counter = $row - 1; ?> I'm having troubles retrieving the information that the user inputs. My intent is to loop through each row after the user has input their information, then upload the mix of my database information and the user's information into another database. For example, the user would see, albeit prettier: form1 Option 1: description [input box] amount [input box] frequency [option box] Option 2: description [input box] amount [input box] frequency [option box] Option 3: description [input box] amount [input box] frequency [option box] Option 4: description [input box] amount [input box] frequency [option box] submit Upon submitting the form above, I'm using a query similar to the following to input the data into the database: for($row=0; $row<=$counter; $row++){ $insertSQL2 = sprintf("INSERT INTO table (option_id, amount, description, frequency) VALUES (%s, %s, %s, %s)", GetSQLValueString($arrayoptid[$row], "int"), GetSQLValueString($arrayamto[$row], "int"), GetSQLValueString($arraydesc[$row], "text"), GetSQLValueString($arrayfreq[$row], "text")); // code to submit query } I've tried for, foreach, arrays (what feels like the everything I know) to post each row (row by row) into the database. I either get just the last row of data, or no data at all. I also worry that the [$row] technique is adding characters to my data. What is the best way to retrieve each row of the user's inputs, then upload this data (row by row) into the database? Also, I would really appreciate your suggestions for improving my coding technique and the approach I'm taking.

    Read the article

  • In CakePHP, how do I create a form to list models withing a date range?

    - by anonymous coward
    I have a very simple model that includes the auto-filled field much like 'created'. (DateTime format). I'd like to use the Form helpers if possible, to validate the date fields and whatnot. I'd like a simple form with a "Begin Date" (YMD, 12 hours), and an "End Date" (same format). There is already a controller action set up as follows: function view_between($start_date = null, $end_date = null) { // ... stuff that works correctly when the URL is manually entered. } Have I defined the controller wrong, or how can I pass these values into that function? The reason I'm stuck is because I tried adding a $form->input('my_datetime_field' ...) twice, but obviously the name/id were the same on the respective elements. I have also tried using $form->dateTime(...) with similar results. I'm not sure how to uniquely identify a Begin and End date selection, when it should interact with a single field. Am I going about this wrong? A kind shove in the right direction should suffice.

    Read the article

  • Form submission and hyperlinks using GET and POST

    - by Jon
    I have a search resource, the user can perform searches by filling out a form and submitting it, the create action is called, the Search is saved, the show action is called, and the results are displayed. This all happens with the default POST, and all works fine. The user may want to save his search in the saved_search table (i don't use the Search table for this purpose as this table stores all searches for the purpose of compiling statistics, and gets cleared on a regular basis). Once the Search is saved, it can be re-run by clicking a hyperlink, this is where i start to get problems. I see no way of getting my hyperlink to run the create action of Search, with a POST request, and the necessary data. I then decided to try to get both form submission and the hyperlink to perform a search using a GET request, i was unable to get form_for to run my Search create action using a GET request, it always seems to get routed to my index action. Can someone suggest a good restful solution to this problem please. Many thanks

    Read the article

  • Perform function on form submit

    - by flight643
    Hopefully this is a pretty simple question! I've got the code working in jQuery to listen for a specific form on a page to be submitted and perform an alert when it is.. I.e.: The form itself doesn't have a name so I am targetting the form within a specific form ID. $("#content form").submit(function() { alert("lorem ipsum dolor?"); }); What would be the syntax for performing this in javascript alone without using jquery? For example, I have this code (below) and just am unsure of how to listen for the form to be submitted to perform an action.. var submitform = document.getElementById("content").getElementsByTagName("form"); Thanks!

    Read the article

  • JavaScript: Text "submit" link?

    - by Tedd
    I have the the following code and want to use a hyper link to submit my form. <form name="form_signup" id="form_signup" method="post" action="/" enctype="multipart/form-data"> ... <input type="submit" value="Go to Step 2" name="completed" /> or <a onclick="javascript:this.form.submit();">Proceed without uploading</a></span> </form> However, my hyperlink submit doesn't work. It just keeps me on the same page. Question: any idea why my link submit text doesn't work?

    Read the article

  • Authenticating a user for a single app with multiple domains

    - by hofnarwillie
    I have one asp.net web application, but two different domains point to this web app. For instance: www.one.com and www.two.com both point to the same web app. I have an issue where I need certain pages to be on a specific domain (due to some security requirements from our online payment provider - a third party website). So let's say page1.aspx needs to be called on www.two.com The process is as follows: A user logs into www.one.com The authentication cookie is saved to the browser The user then navigates to page1.aspx and, if on the wrong domain, gets redirected to the correct domain. (this redirection happens on page1.aspx in the page_load event) Then asp.net redirects the user to the login screen, because the authentication cookie is not sent to www.two.com. How can I track the user and keep him/her logged in between the two domains?

    Read the article

  • How do I toggle two images using jQuery and radio buttons?

    - by trench
    This isn't pretty, but I think you'll get what I'm trying to do. <label><input name="jpgSel" type="radio" value="0">jpg 1</label><br /> <label><input name="jpgSel" type="radio" value="1">jpg 2</label><br /> <div id="showjpg"></div> and $(document).ready(function() { $("select").change(function () { if ($("jpgSel:checked").val() == 1) { $('#showjpg').attr({ src: 'one.jpg', alt: 'one dot jpg' }); } else { $('#showjpg').attr({ src: 'two.jpg', alt: 'two dot jpg' }); } });

    Read the article

  • Set hidden form field values with JavaScript but request still empty

    - by tigerstyle
    HI volks, I try to set some hidden form field values with an onclick event. Ok, after I did something like this: document.getElementById('hidden_field').value = 123; I can output the value with the firebug console by entering this: alert(document.getElementById('hidden_field').value); So the values are definitely set. But now when I submit the form, the hidden field values are still empty. Do you have any idea whats going wrong? Thx for your answers.

    Read the article

  • Customizing Django Form: Required and InputId?

    - by Mark
    I'm trying to customize how my form is displayed by using a form_snippet as suggested in the docs. Here's what I've come up with so far: {% for field in form %} <tr> <th><label for="{{ field.html_name }}">{{ field.label }}:</label></th> <td> {{ field }} {% if field.help_text %}<br/><small class="help_text">{{ field.help_text }}</small>{% endif %} {{ field.errors }} </td> </tr> {% endfor %} Of course, field.html_name is not what I'm looking for. I need the id of the input field. How can I get that? Also, is there a way I can determine if the field is required, so that I can display an asterisk beside the label?

    Read the article

  • How to manipulate string to delete quotes?

    - by user1751581
    I am trying to manipulate a string so that any quotes (") within <a href> and <\a> get taken out... Sorry if its been asked before but I just can't get it to work! By the way, I am POSTing the data from a form and then manipulating the string. This is basically html but its in the form of a string, and I want to take out quotes on things like images and links... Another thing is, I do not want to escape the quotes because that would break the link... And the whole point is that the html can be used and work fine... But now, something is automatically creating a second set of quotes inside the normal quotes, like this: <a href="\"http://www.example.com/\""></a> Example input would be: <p><a href="http://www.example.com">example</a></p> Heres how it appears when I echo it however: <p><a href=\"http://www.example.com\">example</a></p> Heres how I want it to look: <p><a href="http://www.example.com">example</a></p> So I would actually be trying to get rid of the (/) my bad...

    Read the article

  • How do I submit a form from another page?

    - by Tommy
    I have a two page site. Each page contains a header with "tabs" at the top, to navigate between page 1 and 2. When a tab is selected, I need the selected page to re-POST to the server, to quickly refresh before it is displayed. I have a form on each page that allows a manual refresh from that page but need to submit that form from the other page. For example, page 2 is displayed. The tab for page 1 is selected (which is on page 2) It should then submit the refresh form on page 1. Any help is appreciated. (Using jQuery, js, html and CSS)

    Read the article

  • Instantiate a form, then find it later, without showing it initially

    - by awilson53
    I am having a problem that is strange to me but hopefully is not so strange to someone else. : ) Some background: I am working on a simple IM client that allows the user to broadcast messages to multiple recipients. The goal is to create a chat form for each of the recipients containing the text of the broadcast message, then show that form only if the recipient responds to the broadcast-er. However, when the application receives a response then attempts to locate the form for that particular chat session (using Application.OpenForms) it cannot find it UNLESS I .Show at the time it is created. I would like to avoid having to show this form when it is created because this means that the user will see a flash on the screen. The form doesn't seem to really be created until I show it, but it would seem there has to be a way to do this without showing first. Can anyone assist? I can provide code snippets if needed, I didn't in this post because this feels more like a conceptual misunderstanding on my part than a bug in the code. Thanks in advance!

    Read the article

  • prevent form from automatically re-submitting on page load

    - by user323774
    I am using jQuery to point a form's target to an iframe on .submit(). This is to upload a file. It works fine, but when the page reloads, and the iframe is appended to the DOM, the iframe automatically resubmits the form, causing the same file to be sent to the server on each page load. If I do not include the iframe in the HTML markup, or do not append it to the DOM, this doesn't happen, but of course, I need the iFrame. So my question is, how can i prevent this? :) Andrew

    Read the article

  • cakephp - form for belongsTo Model

    - by user1511579
    I createt the following model to link 2 relational tables: class Ficha extends AppModel { //public $useTable = 'ficha_seg'; var $primaryKey = 'id_ficha'; var $name = 'Ficha'; var $belongsTo = array( 'Perigo' => array( 'className' => 'Perigo', 'foreignKey' => false, 'conditions' => 'Perigo.id_fichas = Ficha.id_ficha' ) ); } Now, i have a form that requires data from the class Ficha, and then is redirected to another ctp page where i will input the data for the table "Perigos". However, since i'm still a newbie in cakephp i'm having difficult building that second form to insert the data on the table "Perigos". Here goes the code i built at the moment related to the second form: FichasController.php (the method where is it supposed to save the data on the table "Perigos": public function preencher_ficha(){ if ($this->request->is('ficha')) { $this->Ficha->create(); if ($this->Ficha->Perigo->save($this->request->data)) { $last_id=$this->Ficha->getLastInsertID(); $this->Session->setFlash('Your post has been updated '.$last_id.'.'); //$this->redirect(array('action' => 'preencher_ficha')); } else { $this->Session->setFlash('Unable to qualquer coisa your post.'); } } } The preencher_ficha.ctp file with the form: echo $this->Form->create('Ficha->Perigo', array('action' => 'index')); echo $this->Form->input('class_subst', array('label' => 'Classificação:')); echo $this->Form->input('simbolos_perigo', array('label' => 'Símbolos:')); echo $this->Form->input('frases_r', array('label' => 'Frases:')); echo $this->Form->end('Finalizar Ficha'); Here i guess the create part is wrong, but i think i have errors too in the controller part.

    Read the article

  • form not showing for empty records

    - by Chris Hodges
    I have a relatively simple PHP page called editcustomers with 3 columns. The problem I'm having is that the form will show when there is a record in the database and the fields will be populated with that info. When no such records exists, the form is not even shown, eliminating the possibility to insert a record. My page layout is as follows: Column 1 shows a form containing customer information, allowing it to be edited. Column 2 allows ordering of products and showing how many products were ordered Column 3 shows the total paid so far, and the total owing. The code for the page I have at present: <html> <?php $id = $_GET['id']; require_once('connect.php'); $sth = $dbh->query("SELECT * FROM users where id = '$id';"); $sth->setFetchMode(PDO::FETCH_ASSOC); $eth = $dbh->query("SELECT * FROM purchases where id = '$id';"); $eth->setFetchMode(PDO::FETCH_ASSOC); ?> <div id="main"> <div id="left"> <form name="custInfo" action ="process.php" method ="post" > <input type = "hidden" name ="formType" value="custInfo"/> <?php while($row = $sth->fetch()){ ?> <p><input type = "hidden" name ="id" value="<?php echo $row["id"] ?>"/> <p><input type = "text" name ="firstName" size ="30" value=" <?php echo $row["firstName"]?>"/> <p><input type = "text" name ="lastName" size ="30" value="<?php echo $row["lastName"]?>"/> <p><input type = "text" name ="country" size ="30" value="<?php echo $row["country"]?>"/> <p></p> <input type="submit" value="Update" /> <?php }?> </div> <div id="mid"> <form name="custCosts" action ="process.php" method ="post" > <input type = "hidden" name ="formType" value="custCosts"/> <?php while($row = $eth->fetch()){ ?> <p><input type = "hidden" name ="id" value="<?php echo $row["id"] ?>"/> <p><input type = "text" name ="amountOwed" size ="30" value=" <?php echo $row["amountOwed"]?>"/> <p><input type = "text" name ="numAaa" size ="30" value="<?php echo $row["numAaa"]?>"/> <p><input type = "text" name ="numBbb" size ="30" value="<?php echo $row["numBbb"]?>"/> <p></p> <input type="submit" value="Update" /> <?php }?> </div> <div id="right"> <b>Total Balance</b> <p> Money owed: </p> <p> aaa total: </p> <p> bbb total: </p> <p> Total: </p> <input type = "text" name ="pay" size ="20" /></p> <input type="submit" value="Make Payment" /> </div> <?php $dbh =null; ?> </body> </html> And the code for all the database trickery: <?php require_once 'connect.php'; $formType = $_POST['formType']; $id = $_POST['id']; $firstName = $_POST['firstName']; $lastName = $_POST['lastName']; $country = $_POST['country']; $amountOwed = $_POST['amountOwed ']; $numAaa = $_POST['numAaa']; $numBbb = $_POST['numBbb']; if(empty($_POST['id'])) { $sth = $dbh->prepare("INSERT INTO customers (firstName, lastName, country) VALUES ('$firstName', '$lastName', '$country')"); $sth->execute(); } elseif(!empty($_POST['id']) && !isset($_POST['stayCost']) && $_POST['formType'] == 'guestInfo'){ $sth = $dbh->prepare("UPDATE customers SET firstName = '$firstName', lastName = '$lastName', country = '$country' WHERE id = '$id'"); $sth->execute(); }elseif(!empty($_POST['id']) && isset($_POST['stayCost']) && $_POST['formType'] == 'guestInfo'){ $sth = $dbh->prepare("INSERT INTO purchases (id, amountOwed, numAaa, numBbb) VALUES ('$id', '$amountOwed', '$numAaa', '$numBbb'"); $sth->execute(); }elseif(!empty($_POST['id']) && $_POST['formType'] == 'guestCosts'){ $sth = $dbh->prepare("UPDATE purchases SET amountOwed= '$amountOwed', numAaa = '$numAaa', numBbb= '$numBbb' WHERE id = '$id'"); $sth->execute(); } $dbh =null; ?> Why does the form not even display if there is no record? An error or something I might understand....but the form is still in the HTML and should still be being output, from what I can see. Why is this not the case?

    Read the article

  • ecommerce - use server side code for hidden values in an html form

    - by bsarmi
    I'm trying to learn how to implement a donation form on a website using virtual merchant. The html code from their developer manual goes like this: <form action="https://www.myvirtualmerchant.com/VirtualMerchant/process.do" method="POST"> Your Total: $5.00 <br/> <input type="hidden" name="ssl_amount" value="5.00"> <br/> <input type="hidden" name="ssl_merchant_id" value="my_virtualmerchant_ID"> <input type="hidden" name="ssl_pin" value="my_PIN"> <input type="hidden" name="ssl_transaction_type" value="ccsale"> <input type="hidden" name="ssl_show_form" value="false"> Credit Card Number: <input type="text" name="ssl_card_number"> <br/> Expiration Date (MMYY): <input type="text" name="ssl_exp_date" size="4"> <br/> <br/> <input type="submit" value="Continue"> </form> I have that in an html file and it works fine, but they suggest that the merchant data (the input type="hidden" values) should be in a Server Side Code. I was looking at cURL but it'a all very new to me and I spent a couple of hours trying to find some guide or some sample code on how to accomplish that. Any suggestions or help is greatly appreciated. Thanks!

    Read the article

  • JQuery: can I submit values from inputs that aren't in a form?

    - by Alvaro
    Simple as that: I have some inputs that are rendered inside another form element, but I want to submit then individually. I tried "serializing" the div that contains them, but it didn't work. Is there an easy way to do this? My code: var form = $("#my_div"); var get_data = $(form).serialize(); /* Get #my_div inputs value */ $.get(self.url_form_rendering, get_data, function (data){ /* handle server response */ }) Serialize returns "", any ideas that don't involve redesigning the layout to avoid form nesting?

    Read the article

  • Hit external url from code-behind

    - by Steven
    I have a form on my site. The user enters their e-mail and selects a location from a dropdown. I then need to post that data to an external site by hitting a url with the user's location and e-mail in the query string. I'm doing this like so: string url = "http://www.site.com/page.aspx?location=" + location.Text + "&email=" + email.Text; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); My client says that I am not hitting their server, but when going through the debugger, I'm getting a response from their server. I also tried tracking what was happening by using Firebug, and I noticed that there was no POST made to that external site. What am I doing wrong here?

    Read the article

  • Graphical Submit button doesn't 'post' in Firefox or IE

    - by Ken
    I've looked all over the net to try and solve this problem, but I can't find any solutions. So far, I've checked 3 different browsers. It does not work on IE or FireFox, but it works just fine in Safari. Here's the problem. When I click the button to submit my form, it forwards me to the 'post' URL page - INSTEAD of posting the data, and going to the thank you page like the script commands. Here's the code I'm working with: <form name="loginfrm" method="post" action="http://www.myaffiliatepowersite.com/members/quick_signup.php" style="margin:0; padding:0;"> " /

    Read the article

< Previous Page | 74 75 76 77 78 79 80 81 82 83 84 85  | Next Page >