html-form

Calling JS Function on Form Submit

I have created a JS function which executes fine when it's included an the 'onclick' action of standard HTML link tag as follows: <a href="#" onclick="return fb_CheckPermission('publish_stream');">test</a> However where I really want to use this function is on the 'onsubmit' action of a form but when I include it as follows the functi...

How to feed an xml database with tags obtained thru html forms ?

Hello! Not a programmer, I begin with xml, html forms and xslt on Mac. I plan to use a form to post short texts in a xhtml page and invite end users to add some annotations to the said text. The users would select a specific part of the text posted and each annotation would stand for one specific chain of characters. My goal is to c...

Form loop db insertion + javascript altering

I basically need to check if there is an easier way to do this before I rewrite all the code. I have a fairly large form that I have each input named with []'s on the end so I can loop through via php for easy insertion. <input type="hidden" name="currentdate[]" value="<?php echo date('mdY'); ?>"> <td><input...

Browser freezes when try to call a JS function along with submission of a form.

I have form in my view like following 1 <div> 2 <% form_tag facebook_user_path do %> 3 <label>Use my photo and name from facebook?</label><br /> 4 <%= check_box_tag 'use_name_and_photo', 'yes', true %> 5 <img src="<%= @user.pic %>" /><% @user.name %> 6 7 <%= submit_tag "Finish", :id => "use_name_and_phot...

Jquery attach show event to select option

Hi, I have a select form element with 5 options. If option 2 is selected I want to display another form input box (this has a style of display:none initially). How can I attach an event to option 2 so that whenever it is selected the input box is shown otherwise it is hidden. I have this currently but this does not handle is option 2 ...

HTML - Put SELECT tag content into INPUT type = "text"

Hi, I have a form in a webpage where I would like to put the selected item in a drop down list into a testbox. The code I have till now is the following: <form action = ""> <select name = "Cities"> <option value="----">--Select--</option> <option value="roma">Roma</option>...

Convert an HTML form field to a JSON object with inner objects.

Given the following HTML form: <form id="myform"> Company: <input type="text" name="Company" value="ACME, INC."/> First Name: <input type="text" name="Contact.FirstName" value="Daffy"/> Last Name: <input type="text" name="Contact.LastName" value="Duck"/> </form> What is the best way serialize this form in javascript to a JSON ob...

How can I customise Zend_Form regex error messages?

I have the following code: $postcode = $form->createElement('text', 'postcode'); $postcode->setLabel('Post code:'); $postcode->addValidator('regex', false, array('/^[a-z]{1,3}[0-9]{1,3} ?[0-9]{1,3}[a-z]{1,3}$/i')); $postcode->addFilters(array('StringToUpper')); $postcode->setRequired(true); It creates an in...

What are the pros and cons using javascript in our form?

I got this code in my submit form <form id="myform" action='hello.php' method='GET'> <input type="button" name="newWin" onclick="frmSubmitSameWindows();"> <input type="button" name="SameWin" onclick="frmSubmitNewWindows();"> <form> Then use some js functions in the head; function frmSubmitSameWindows() { form.target = ''; f...

How do you do HTML form testing without real user input simulation ?

this question is like this one, except it's for PHP testing via browser. It's about testing your form input. Right now, i have a form on a single page. It has 12 input boxes. Every time i test the form, i have write those 12 input boxes in my browser. i know it's not a specific coding question. This question is more about how to do di...

How can a Script be passed through a TextArea into a Form?

I need to make a form with a Text Area that accepts lines of script, any kind of script be it javascript, css, html, vbscript, whatever. How can the script be passed to a form post? EDIT: How can this script be modified so it can be inserted into a Database? Specifically SQL Server 2005 ...

How can I retain carriage returns when I'm encrypting data?

I have this following setup, a textarea named with some data in it that may have carriage returns and another textarea that has style='display:none' in order to make it hidden as follows: <textarea id="myTextarea" onBlur="encryptMyData()"></textarea> <textarea name="encryptedText" style='display:none'></textarea> the user enters data ...

howto hide outline on a form

I have to design a form with an input inside it. I use background image on the input so it would look like a button. Every time somebody clicks it, it would send $POST, a behavior I want to achieve. But the problem is about the outline around the form. The outline shows when we click the form. It's minor, but it would be great to make ...

HTML text input and using the input as a variable in a script(tcl)/sql(sqlite)

Hello all, I'm very VERY new at this whole web thing. And I'm just very confused in general. Basically, what I want to do is take an input via text using HTML and adding that input to database, table trans. Should be simple but I am lost. <li>Transaction Number</li> <li><input type=|text| name=|tnumber| </li> // do i need to use...

Make page to tell browser not to cache/preserve input values

Most browser cache form input values. So when user refreshes page, the inputs have same values. Here's my problem. When user clicks Save, server validates POSTed data (e.g. checked products), and if not valid, sends it back to browser. However, as stated above, even if server clears selection for some values, they may still be selected ...

Google Analytics Widget Tracking

Hello, I have a form that is generated on a customer's website (lets say customer.com) with javascript that a user fills out and it sends to my site (app.com). I would like to be able to provide information to the customer such as how effective their AdWords campaign was and what search engines users used to end up filling out the form....

How best to convert CakePHP date picker form data to a PHP DateTime object?

I'm doing this in app/views/mymodel/add.ctp: <?php echo $form->input('Mymodel.mydatefield'); ?> And then, in app/controllers/mymodel_controller.php: function add() { # ... (if we have some submitted data) $datestring = $this->data['Mymodel']['mydatefield']['year'] . '-' . $this->data['Mymodel']['mydatefield'...

Prevent double submission of forms in jQuery

I have an form that takes a little while for the server to process. I need to ensure that the user waits and does not attempt to resubmit the form by clicking the button again. I tried using the following jQuery code: <script type="text/javascript"> $(document).ready(function(){ $("form#my_form").submit(function(){ $('input')....

Best way to layout in HTML forms?

I want to display an HTML form containing labelled text fields, like this: First Name: [_____________] Last Name: [_____________] Date of Birth: [________] My obvious approach is to use a <TABLE> and simply place the labels and text fields in its cells, but is there a better way, e.g. a CSS-based approach? EDIT:...

need to run php script when form is submitted

I have a form that needs to run a php script once the submit button is clicked, it needs to be ajax. <form method="post" action="index.php" id="entryform" name="entryform"> <input type="submit" name="submit" value="Submit" onclick="JavaScript:xmlhttpPost('/web/ee_web/include/email-notification.php', 'entryform')" /> </form> In this si...