forms

How do I use Javascript to force cursor to specific form field when form field has a name with brackets?

I am using CakePHP as my framework. On page load, I want to force the cursor to a specific form field where name="data[Project][title]" I'm trying to use javascript: This works fine if I change the name to something without brackets, but fails to work with this form name. I have to use this form field name because of how CakePHP pro...

Using a form to update data in MySQL

Having trouble getting my form to UPDATE records in my database even after searching the web and viewing the other answers on stack-overflow. Here is my current NON functioning code: if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) { session_start(); $tablename = $_SESSION['MM_Username']; $amount=$_POST['amount'];...

Email form results with jquery?

Can anyone show me a script or example of a form results being emailed with submit? Does jquery have any advantage with this? Erik ...

Javascript... simple question how to keep the form on the page after submitting

Please see following example code that takes a year and a date and displays the data back when submitted... <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <meta http-equiv="Content-Type" content="text/html...

form.fields_for do for a finite number of times

Hello, I have two models, Product and ProductImage, and I'd like to offer the possibility to add up to 6 images to each product. Product has_many :product_images, :dependent => :destroy while ProductImage belongs_to :product So far, my views are the following: #products/_form.html.erb. <% @product.product_images.build %> ...

jQuery: I set a spinner image, then submit the form, but the image doesn't appear

I have a form submit link labeled "OK", and I want to have a spinner to indicate that something is happening when it's clicked. I tried adding an image to the clicked span before submitting the form, but it doesn't appear: function submitMyForm() { $(this).html($(this).html() + "&nbsp;&nbsp;<img src='/img/spinner.gif'>"); $("#m...

Self-Referential Association has a routing error..

I am following Ryan Bate's tutorial: http://railscasts.com/episodes/163-self-referential-association But my setup is slightly different. I am making comments that are self-referential so that comments can be commented on. The form displays in the view, but when I submit, I get this : Routing Error No route matches "/conversations" ...

Drupal Form API: Create Form Elements based on the database values (Dynamic Form Creation)

Hello Everyone, I am creating a form where i have to populate "X" form elements (text-fields to be specific) based on values in the database (X number of elements, properties of each element etc). Is there a way to do this using the Drupal Form API or should i start from somewhere else. I tried using a for() loop in the form generating...

Using a MS Access Tab Control for Navigation

I'm scratching my head whether this idea is worth exploring: I'd like to use a tab control to filter a subform field by the value of the tab control page. There are about 5 different values for that field, so it would be neat to have 5 tabs where you click on the tab and see the list of just those matching records. I'm a bit of an Acce...

Augmenting Bates' `find_commentable` method

I'm watching a Ryan Bates screencast on polymorphic relationships, and he uses this private method for finding all comments related to a nested model. So I could find all the comments of a given Post with this : def find_commentable params.each do |name, value| if name =~ /(.+)_id$/ return $1.classify.constantize.find(value...

jQuery formular onEnter

I have a form with two input fields, one text and one send button. I want to submit via jQuery .ajax() without reloading the document. It works as long as the button is clicked, but not when you press return/enter, then it submits without ajax methodology. I tried onEnter() or onSubmit(), but that didn't work either. These are the code ...

Get option value AND text with PHP

Let's say I have a HTML form: USA CDN And I select option 1 (USA) Then a php page Ok, duh, works fine and echo's "1" How can I display "USA" as well? So in essence, I want to pass along the option's TEXT also. How could I do this? ...

Wrong variable being passed in PHP form

Here is my code: echo "<table class='forum'> <tr> <td class='forum'><b>Enter Response Here:</b></td> </tr> <form action='a_insert.php?id=" . $answerid . " method=post> <tr class='forum'> <td class='forum'><textarea rows='5' cols='80' name='cBody'></textarea></td> </tr> <tr class='forum'> <td><input type='submit' value='submit'></td></tr...

Drupal form validation functions

Is there anyway say Drupal to validate form elements like email fields, passwords, numeric fields validate automatically lets say bind a system validator $form['email] = array( '#title' => t('Email'), '#type' => 'textfield', '#validate_as' => array('email', ...), ... ); ...

jquery arrays intersect

Hi, I previously posted this question as jquery/javascript: arrays - http://stackoverflow.com/questions/3969576/jquery-javascript-arrays. But since I am a complete beginner I have formulated the question wrong and didn't understand the answers either.... :( After failing to implement the given solutions I did some more looking around I...

Using AJAX When Processing JSP Form?

I am just learning how to use JSP and am stack on a small issue. I am creating a basic form where the user inputs some text and then when they submit the form it gets sent to a JSP page. The JSP then outputs what the user inputted using the request.getParameter() call. Now this works fine but i would like the data to be sent to a JSP pa...

Is it necessary to use PHP in order to create an automated form for a web page?

Hi all, Is there an easy way to set up an automated form on a web page that sends info to a specific email address after being filled out? I don't know much about php, but someone mentioned it as a possibility. I would like to create a form that gets filled out and sent to a server email address automatically. Preferably without having ...

dynamic element id with php and jquery

Ok this might be a bit confusing, but here goes. Let's say I have a a few select dropdowns on a page. <select id="filter" name="filter[]"> <option value="">-- Select Filter --</option> </select> <select id="load_choice" name="load_choice[]"> <option value="">-- Select Load_choice --</option> </select> ...

Clone div and rename element ids incrementally

Ok lets say I have div with form elements inside of it. I want to be able to clone that div with a button click using jQuery and add a version 2 of the form, so ALL of the element IDs will increment by 1 in their name. <div id="card"> <!-- PART 1 --> <h1 class="card_build">Build your card options:</h1> <select id="country...

How can I access the captcha image that was generated when the page was loaded?

On some websites, when you want to login, you need to enter a captcha as well. If I want to provide support for an user to enter a captcha into my application ( which will then log into the website ), how would I do this? My problem is that the link to the captcha image is like this: example.com/captcha , and it serves a different image...