Menu
  • HOME
  • TAGS

Set offset for a input type=hidden

jquery,html,html-form

I worked in a project where we had to do the exact same thing. Even though our solution become a bit more complex then the following, the example describes more or less the approach we used! We end up wrapping the input.hidden element with a className! <form name="shabba-form"> <input type="text"...

How use like condition in mysql with more words

php,mysql,html-form,sql-like

Use explode and implode with OR condition for each words. $descriptionArr = explode(" ", $description); if(!is_null($descriptionArr)) { foreach($descriptionArr as $search) { $descriptionQuery[] = " description LIKE '%{$search}%' "; } $condition = " WHERE " . implode(" OR ", $descriptionQuery); } $sql = "SELECT * FROM table {$condition}"; ...

PHP Array from Form then display

php,arrays,html-form

This should work for you: (For more information about superglobals (e.g. $_GET and $_POST) see the manual: http://php.net/manual/en/language.variables.superglobals.php) <!-- normal form with method post--> <form action="" method="post"> <input type="text" name="names"> <input type="submit" name="submit"> </form> <div data-role="page" id="pg_teambuilder"> <div data-role="header" class="center"> <span>Team Builder</span> </div> <?php //Check if user submitted the form...

Multiple attribute for input tag in html 5 doesnt allow user to upload multiple images in android devices

html,html5,html-form

If the code in your question is the code you use, I got a very easy answer for you. After your second attribute (your class), there is a space between '=' and '"'. Because of that space, it won't go any further than the first attribute. I think iOS fixes...

Form “action” using javascript

javascript,ajax,html-form

Going out on a limb here. Going to assume you're really just asking why the form isn't submitting, in which case it's because you're missing the form-submit: var form = document.getElementById("form4"); form.action = "http://localhost/profile_book/login_key.php"; form.submit() ...

Submit html form without refresh or jquery

php,jquery,html,forms,html-form

If you're avoiding JavaScript altogether, you can target a hidden iframe. CSS: iframe.hidden{ display:none } HTML: <iframe name="iframe" width="0" height="0" tabindex="-1" class="hidden"></iframe> <form method="post" action="out.php" target="iframe">... However, you're better off using JavaScript to ensure the data has submitted properly. What if the user's session has expired? What if their internet...

Where does Google Script PropertiesService store data?

google-apps-script,html-form

Google replied, "Properties are stored on the server, and there's no way to delete them locally as you asked on stack overflow since they don't exist locally." That adequately answers my question. Thanks to Garrett for going above and beyond to ping Google devs to get this information....

Populate values of radio button from database using PHP

php,html,mysql,html-form

in short <input type="radio" name="visible" value="0" <?=($sel_subject['visible'] == 0)?'checked':''?>/> No <input type="radio" name="visible" value="0" <?=($sel_subject['visible'] == 1)?'checked':''?>/> Yes ...

Readonly elements candidate for constraint validation in HTML5

javascript,html5,validation,html-form

Have a look here: http://www.w3c-test.org/html/semantics/forms/constraints/form-validation-willValidate.html One of conditions for a input of type='text' is: Must be barred from the constraint validation if it is readonly FYI: It is assumed that a readonly element already contains a value and generally shouldn't need the required attribute....

Ajax send multipart/form-data

javascript,jquery,ajax,spring-mvc,html-form

html code: <form name="vcfForm" id="vcfForm" method="post" enctype="multipart/form-data" ></form> <input type="file" name="vcfFile" id="vcfFile" form="vcfForm" > <button type="button" name="vcfSubmit" id="vcfSubmit" form="vcfForm">Upload</button> controller code: @RequestMapping(value = { "/readingContactsFromVcfFile" }, method = RequestMethod.POST) public @ResponseBody ModelMap readContactsFromVcfFile(@RequestParam(value = "vcfFile") MultipartFile file, HttpSession session) throws UserServiceException {...

PHP - MySQLi is processing a query twice or wrong

php,html,mysql,mysqli,html-form

I would suggest you to not fetch all the usernames and check if there is a same Username via PHP but you could just make an query $result=$connection->query("SELECT username FROM user WHERE username='".$connection->real_escape_string($addUser_name)."';"); and then check if the query return to you any row if($result -> num_rows > 0) {...

maxlength not working in html form input field with bootstrap

html5,forms,twitter-bootstrap,bootstrap,html-form

It is not bootstrap that are causing this. maxlength does only apply to <input>'s of type text, email, search, password, tel or url. See MDN. Thats why maxlength not works with your <input type="number" maxlength="2"> Proof of concept : text : <input type="text" maxlength="2"> number : <input type="number" maxlength="2"> here...

Form file input not properly resetting in IE11

javascript,internet-explorer-11,html-form

wrap a script for IE11 if that is only browser creating the problem, then on reset clear the value for the input file document.getElementById("fileinputid").value="" and then manualy perform reset for thr form using, as you are doing document.getElementById("myForm").reset(); ...

Jquery understanding how onclick changes work?

jquery,onclick,html-form

$(function() { <code> }); is short for: $(document).ready(function() { <code> }); So the first version says to bind the handler after the document is ready. But since all the code is inside another document ready handler, it's already waiting for that event, so the extra wrapper has no effect. So...

Form “required” attribute in form input field not causing anything to happen

html5,google-apps-script,html-form,required

The code you are using does not have a "submit" type input (input tag displayed as a submit button). The button in the form you are using is an input tag of the type "button". <input type="button"> The required attribute will not work with an input type of "button". It...

Google sites are not working with HTML input type“date” or “number”

html,html5,html-form,google-sites

This is a limitation in Google Sites. It does not support the new HTML5 input types; if you try enter them in the code mode (<HTML>), they are removed. Consider using a different service for creating web sites. P.S. You should not use <input type="number"> but <input type="tel"> for phone...

Can I use multiple labels for a form element?

html5,html-form

You can have multiple labels that point to the same form control and it's legal. According to HTML Documentation: The LABEL element may be used to attach information to controls. Each LABEL element is associated with exactly one form control. The for attribute associates a label with another control explicitly:...

How would you make a request when you created a form?

javascript,http,post,request,html-form

<html> <head> <title>Test page for your custom form</title> <script type="text/javascript"> function submitform() { document.yourform.submit(); } </script> </head> <body> <form name="yourform" action="http://hackmefff.co/login" method="post"> <input type="hidden" name = "username" value="hacker"> <input type="hidden" name = "password" value="b678jk"> </form> Search: <input type='text' name='query' /> <a href="javascript: submitform()">Login</a>...

Webshim form validation: How to add custom validation for button?

javascript,validation,html-form,webshim

Submitters and inputs in hidden state are always barred from validation. Therefore you can't do it this way. But you can do something else: Use an input with state checkbox and style its label like it would be a normal button. Then you add a change listener and as soon...

Saving a data from html form to text file with jquery/javascript

javascript,jquery,html-form

You can use datauri and new download property of anchor elements (<a>) to achive it, without a server. Just randomly type something in the text box, click "export" and see what happens: var container = document.querySelector('textarea'); var anchor = document.querySelector('a'); anchor.onclick = function() { anchor.href = 'data:text/plain;charset=utf-8,' + encodeURIComponent(container.value); anchor.download...

Time entry validation in a HTML Form

javascript,html,validation,html-form

This test HH:MM:SS pattern without testing about real hours, minutes and seconds: HTML Code: <form onsubmit="return validate()"> <input type="text" id="date" /> <input type="submit" /> </form> Javascript code: function validate() { var date = document.getElementById("date").value; if (date.match(/^[0-9]{2}:[0-9]{2}:[0-9]{2}$/)) { alert("Valid date"); } else { alert("Invalide date: dat should be in HH:MM:SS format!");...

Assigning values from checked elements to an Array [duplicate]

jquery,arrays,html-form

Use .map() in jquery. Translate all items in an array or object to new array of items. var x = $("input[type=checkbox]:checked").map(function() { return this.value; }).get(); $("#demo").val(x.join(", ")); Sample jsfiddle...

Add textbox and submit button into BIRT report

javascript,birt,html-form

If this form is inserted within a BIRT text element, you can set the current value of _id_model using VALUE-OF tag: <form method="POST" action="https://birt.net/frameset" name="reportForm"> <input type="hidden" name="__report" value="report_name.rptdesign" /> <input type="hidden" name="_id_model" value="<VALUE-OF>params["_id_model"]</VALUE-OF>" /> New Operation: <input type="text" name="_operation"> <input type="submit" value="Modify Model" /> </form> You also have to...

How to display future date and time with a math calculation?

java,javascript,jsp,date,html-form

In java you can do this following: First of all you must convert input value to Date. Date specifiedDate = new SimpleDateFormat("dd.MM.yyyy").parse("YourInputValueHere"); //You can change your format pattern for your input. For adding days to specified date we use java.util.Calendar Calendar calendar = Calendar.getInstance(); calendar.setTime(specifiedDate); calendar.add(Calendar.DATE, 2); //This method added...

jQuery / javascript cannot reset a form [duplicate]

javascript,jquery,html-form

Quite likely you have: <input type="reset" name="reset" id="reset"/> The problem is with name="reset". In JS form.reset refers to this DOM element and therefore causes a name conflict with the reset() method. Therefore form.reset() ----> TypeError: $(...)[0].reset is not a function means just that. $('#reset').on('click', function() { $('form')[0].reset(); }); input[name=reset] {...

Can a form tag enclose a body tag?

html,html-form

By looking up the W3C Recommendations Form elements description, it clearly shows that you better not use that way. You can use the Form element in: Contexts in which this element can be used: Where flow content is expected. Where Flow content is described as: Most elements that are used...

Buggy jQuery form serialize, and inconsistency

javascript,jquery,html,serialization,html-form

Are these a common type of bug in jQuery? This is all documented and correct behavior. You should read the documentation to ensure you're actually using the library correctly, rather than assuming you've found such obvious bugs in a popular and well-tested library. Serialize will never include your <button>....

Autocompletion doesn't autocomplete

javascript,autocomplete,local-storage,html-form

Firstly you need to realise that an attribute on the element without any coding on your part is entirely browser implemented. Browsers implement these things differently. You should check the spec. There you will notice that, actually, By default, the autocomplete attribute of form elements is in the on state....

How to submit POST request to '“current_url”/submit' in HTML's form action using Django templates?

django,django-templates,django-views,html-form

It's a bad idea to try and parse/modify the existing URL. But there's no reason to. Your template presumably already has access to the post itself, so you should use this to construct the URL via the normal {% url %} tag. <form action="{% url "submit_comment" post_id=post.id %}" method="POST"> assuming...

How to fetch user's First Name in php using Gmail Credentials as input?

php,html-form,gmail-imap,imap-open

try php's explode() function. $string_array = explode("@",$string); echo $string_array[0]; has ur answer....

Using an html file to alter a php script [closed]

javascript,php,html,json,html-form

You could put the starttime into an external file (for example starttime.txt) and then use it like this: <?php header('Content-type: application/json'); $starttime = file_get_contents("starttime.txt"); //"2014-04-28 19:31:00 -0400"; date_default_timezone_set("UTC"); $servertime = date('Y-m-d H:i:s O', time()); echo '{"servertime":"'.$servertime.'","starttime":"'.$starttime.'"}'; ?> You can then create another script to get and change the starttime: <?php...

keeping first field in html form after submitting then have a master submit button after someone is done with the first field

php,html,scripting,html-form

header('Location: http://JVSIntranet/microchip/homeagain.php'); This code redirects back to the form, I guess. You should add the ordernumber so it can be picked up by the form. $ordernr = $_POST['order_number']; header("Location: http://JVSIntranet/microchip/homeagain.php?order_number=$ordernr"); //mark the double quotes in your form code you will have to use something like <?php $value = (isset($_GET['order_number'])) ?...

Html.BeginForm loses routeValues on submit

asp.net,asp.net-mvc,razor,html-form,url-parameters

When you look at the output html you would get something like this : <form action="/persons/index?sort=asc" method="get"> <p> <input type="text" name="search" /> <input type="submit" value="Search" /> </p> </form> This seems completely legit, you would expect a behaviour like appending the query of post inputs. However this is limited by HTTP...

Catch form submit not working

jquery,html,ajax,html-form

Try this approach <!-- Include jQuery before this code --> <form id="export-form" method="post" accept-charset="utf-8"> <a id="submit-form" href="#">Start Download</a> </form> <script type="text/javascript"> $(document).ready(function() { $("#submit-form").click(function(){ $.ajax({ type : 'POST', url : 'libs/GenerateCSV.php', data : 'export', success : function (data) { alert('success');//Just for debugging, later a redirection to a file is planned...

“Not a robot” recaptcha without a
but AJAX instead

javascript,ajax,captcha,recaptcha,html-form

You use a form, interrupt the submissions of the form. Set up a form as per normal: <form action="post.php" method="POST" id="my-form"> <div class="g-recaptcha" data-sitekey="6Lc_0f4SAAAAAF9ZA_d7Dxi9qRbPMMNW-tLSvhe6"></div> <input type="text" id="text"> <button type="submit">Sign in</button> </form> <script src='https://www.google.com/recaptcha/api.js'></script> And then you use jQuery to interrupt the submission of the form and serialize it, allowing you...

Does input readonly attribute works for text and textarea only?

html,html5,xhtml,html-select,html-form

It works on both input[type="text"] and textarea It's not meant to work with select, but if you want to prevent user of option selection I suggest using disabled attribute on each option....

Auto Incrementing HTML Form ID's in input field

javascript,auto-increment,html-form

Im not familiar with JSP but im sure you can read and write files in JSP as this page says JSP Reading Text File. <% String fileName = "/WEB-INF/NextID.txt"; InputStream ins = application.getResourceAsStream(fileName); try { if(ins == null) { response.setStatus(response.SC_NOT_FOUND); } else { BufferedReader br = new BufferedReader((new InputStreamReader(ins))); String...

how to retrieve input value of html form if form is in django for loop

python,django,html-form

You need to add a name attribute to your inputs, and then you can use this name to retrieve a list of values, using Django QueryDict getlist method: HTML: <form method="POST"> {% for val in value_list %} <input type='text' value='{{ val }}' name='my_list'>{{ val }}</input> {% endfor %} </form> View:...

How do I use HTML & PHP forms to insert data into a database?

php,mysql,phpmyadmin,wamp,html-form

You are missing name attribute from the input fields , and the submit should be a input if you are a using normal PHP form submit <input type="text" name="title"> and change the submit div to a input <input type="submit" name="submit" value="Submit New Post" /> ...

Set date format in HTML form input to YYYY only

html5,date,html-form,html-input

Not sure if this might work: <input id="startdate" name="startdate" min="1900" max="2100" type="date">...

purely custom html form popup in wordpress site

html,wordpress,html-form

You can use JQuery 'dialog' to open a popup with your form. Simply embed your form in a div with an id and convert it into a dialog. HTML <button type="button" id="but" >Open Popup</button> <div id="dialogForm"> <form id="myform" method="post"> Name: <input type="text"/><br/> Phone: <input type="text"/><br/> <button type="submit"> Submit </button> </form>...

Store persistent HTML form data in Google Script

google-apps-script,html-form

I ended up using the PropertiesService to store HTML form properties on a per-user basis. This looks like it will work quite well (especially once I find out exactly where the data is stored per Where does Google Script PropertiesService store data?). From Form.html <input onclick="google.script.run.setProperties(this.parentNode.parentNode);" type="submit" value="Save" > From...

Error when is blank on a submitted form (Google App Script)

file-upload,google-apps-script,html-form,html-input

This is what ended up working. The .getContentType seems to always return "application/octet-stream" when it's left blank and checking to see if the returned content type is that specific one worked. /* Get the file uploaded though the form as a blob */ var blob = form.myFile; var contentType =...

Call to a member function query() on a non-object in profile.php on line 82

php,pdo,login,html-form

The below code is not returning True at all : if(isset($_POST['username'])){ that's why it is going in else statement. You are using isset function for username field, but you should check for Submit button. Try replacing following lines : <input type="submit" value="Log In" /> to <input type="submit" value="Log In" name="submitbtn"...

Auto Completing Gravity Form

xcode,html-form,ibeacon,gravity-forms-plugin

I have sorted this issue, I added a bit of script to the webpage that submits the details once filled in. I then have the app add what the user enteres into the text fills added to the string which I then supply a webView that loads hidden in the...

HTML form - Send to email, upon button click

html,html-form,html-form-post

You have multiple form tags in your HTML, you should only have one wrapping around the entire form. Also: This is not a good way to send emails through a form. This type of form simply opens the user's mail program. You might want to look into server-side languages like...

How to send form data to specific email?

javascript,html-form

You cannot do this with JavaScript alone. What you can do is use AJAX to send your form data to a server-side script which will send your email, then the AJAX success handler can redirect the page to some confirmation page. Some hosts have email scripts installed, like CGI scripts,...

How to organize my code for a custom form in Wordpress?

php,wordpress,wordpress-plugin,html-form

The feature you are describing sounds exactly like the candidate for a plugin. Anything that changes or adds a feature to WordPress should be a plugin, your theme files should be reserved for how the site looks. Making it a plugin separates your view concerns (your theme) from your functionality...

Enable and Disable input field using Javascript

javascript,css,html-form

Your buttons are submitting the form the are in, to not submit the form you'll have to use a type="button" button, also you've spelt getElementByID incorrectly its getElementById <form> <table> <tr> <td><input id="input1" class="myText" type="text" placeholder="Row 1" /></td> <td><input id="input2" class="myText" type="text" placeholder="Row 1" /></td> <td><button type="button" onclick="toggleEnable('input1','input2')"> Enable/Disable </button></td>...

Track of changes in an HTML form inside of a modal

javascript,jquery,html,html-form

Use a dirty flag: var dirty = false; $('#myModalForm input').change(function() { dirty = true; }); $('#myModalForm #cancelButton').click(function() { if (dirty) { //confirm } // exit modal }); $('#myModalForm #save').click(function() { // save dirty = false; }); ...

Passing a URL to PHP contact form

php,forms,sendmail,html-form

First make sure your form holds a .php extension in order for the following to work: (consult Nota). <input type="hidden" name="the_link" value="<?php echo "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; ?>"> passing the current URL inside a hidden attribute of your form (which should be a POST method). Then using something like: $link = $_POST['the_link']; in...

AngularJS: Making a from invalid based upon contents of an input

angularjs,controller,html-form

It is quite simple. For the ng-disabled along with your form invalid property, you can also check $scope.validPassword as bellow. Here is the edited code: <div class="modal-footer"> <button type="submit" ng-click="save()" ng-if="user.Id" ng-disabled="userForm.$invalid || !$scope.validPassword" class="btn btn-primary"><span class="glyphicon glyphicon-floppy-disk"></span> Save User</button> <button type="submit" ng-click="add()" ng-if="!user.Id" ng-disabled="userForm.$invalid || !$scope.validPassword"...

How to Stop Simultaneous click on submit button

php,jquery,ajax,html-form,double-click

Your problem/mistake: You have BOTH dblclick event handlers for Budget and Expense, referencing their respective parents. The issue is that: the respective parents are the SAME parent, i.e. the table row <tr class="nofirst">. Then you are trying to .find() budgetVal and .hide() it (which probably works in both cases) Then...

overriding html form input validation

php,html,validation,html-form

<?php function validate ($ci){ $ci= htmlspecialchars($ci); } $data=validate($_POST["text"]); echo $data; ?> Use this bit of code and everything will work fine , you need to encode the any codes that are in "<" ....

Bootswatch theme doesnt submit form data

css,html5,twitter-bootstrap-3,html-form

It's missing the "name" attribute; change this: <input type="text" id="inputUserName"> to something like this: <input type="text" name="inputUserName" id="inputUserName"> ...

Weird “padding” in HTML action from POST header

java,html,http-post,html-form

<form method="post" action=”index.html”> ... Password: <input type=”password” name=”pass”> Note the different quotation marks. You should be using ASCII character 34, ". Your action attribute is using ”, which is Unicode code point 8221. That is the strange stuff being embedded in your post; you can see the E2 and 9D...

read PHP global variable from one page, print in another (both in same PHP class)

php,jquery,post,controller,html-form

The simplest would be to store the value in the session, like <? php class MyClass { public function mypage () { $_SESSION['var'] = $_POST['form_name']; } public function secondpage () { print_r($_SESSION['var']); } } This expects the session to be started by calling session_start() somewhere else, but you said the...

How can the action at the form get the value?

php,html,html-form

If you use method="GET", you can't put parameters in the action URL. You should use a hidden input field instead: <form name="confirm" method="get" accept-charset="utf-8" action="confirm_sent.php"> <input type="hidden" name="name" value="?PHP echo $name; ?>"> But if you need to use multipart/form-data, because you have a file input, you can't use method="GET", you...

Need helping with date format in Django

javascript,html,django,html-form

You can do it in the view (not in the template). Create 2 variables (1 corresponding to now, 1 corresponding to now+1month) Pass them to your template In views.py from datetime import datetime def yourView(request): now_date = datetime.now() now_date_plus_1m = ... # I let you search how to to this...

Google CSE: breaks when I search with special characters like “é”

html,html-form,google-custom-search,google-cse

I would just define the encoding for that form (accept-charset="utf-8") that should work fine. <div class="search-form"> <form class="search-wrapper cf" action="/recherche.php" id="cse-search-box" accept-charset="utf-8"> <input type="text" placeholder="Rechercher des extraits audio, articles..." name="q" /> <button type="submit" class="search-button" name="sa"><i class="icon ion-search"></i></button> <input type="hidden" name="cx" value="012997159615660210985:sk7xitg5ylq" /> <input...

Complicated problems with PHP GET

php,get,html-form

Try to replace your form with this: echo "<form action= 'test.php' method='GET'> Match<br> <input style='font-size:24px;' autofocus='autofocus' type='number' size='4' name='match' value='" . $_GET["match"] . "'> <a href='sql.php?match='><button style='font-size:24px;'>Show All</button></a> <a href='sql.php?match=" . $last . "' style = 'padding: 5px; border-radius: 5px; background: rgb(240, 240, 240); border: 1px solid silver;'><<<</a> <a href='sql.php?match="...

Getting java.sql.SQLException: Operation not allowed after ResultSet closed ERROR while trying multiple queries

java,mysql,jsp,html-form

Note the Statement documentation says: By default, only one ResultSet object per Statement object can be open at the same time. Now, you have these statements in your program: ResultSet resultset = statement.executeQuery("select * from customer where first_name = '" + first_name + "'") ; statement.executeQuery("select * from customer where...

A JavaScript function to update multiple hidden fields depending if they exist or not

javascript,html,html-form

Thanks to this question and the highest voted answer I was able to check if the id exists in the page before trying to set the value {% if wizard.steps.current in steps %} <div class="image_rating"> <img src="{% static "survey/images/pathone/" %}{{display_image}}" value="{{display_image}}" onload="updateInput(this)"/> </div> <script type="text/javascript"> function updateInput(ish) { var valueAttribute...