logo
down
shadow

JQuery input form is not working


JQuery input form is not working

By : user2948643
Date : November 14 2020, 04:51 PM
With these it helps See the problem is that you are setting the same data, i.e. val in both cases. Check the following
code :
  <script type="text/javascript">
   $(document).ready(function($) {
    $('input#shortby').val(<?php echo (isset($_POST['shortby'])) ? json_encode($_POST['shortby']) : ''; ?>);
    $('input#radius').val(<?php echo (isset($_POST['radius'])) ? json_encode($_POST['radius']) : ''; ?>);
    $('ul li').on('click', function() {
        var shortbyVal, radiusVal;
        if($(this).data('val') === undefined){
            radiusVal = $(this).data('val2');
            shortbyVal = $('input#shortby').val();
        }
        else if($(this).data('val2') === undefined){
            shortbyVal = $(this).data('val');
            radiusVal = $('input#radius').val();
        }$('input#shortby').val(shortbyVal); 
     $('input#radius').val(radiusVal);
     $('#order').submit();
     });
    });
  </script>

</head>
<body>

<?php
 echo "POST VALUE: ". $_POST['shortby'];
 echo "POST VALUE: ". $_POST['radius'];
?>

<form action="1.php" method="post" id="order">
  <input id="shortby" type="hidden" value="" name="shortby">
  <section class="container">
    <div class="dropdown">
       <div>Sort By: <?php echo $_POST['shortby']; ?>
        <ul>
          <li data-val="Featured"       ><a href="#" >Featured</a></li>
          <li data-val="Name"           ><a href="#" >Name</a></li>
          <li data-val="Price (Highest)"><a href="#" >Price (Highest)</a></li>
          <li data-val="Price (Lowest)" ><a href="#" >Price (Lowest)</a></li>
        </ul>
      </div>
    </div>
  </section>

  <br>
  <br>
  <br>
  <br>


  <input id="radius" type="hidden" value="" name="radius">
  <section class="container">
    <div class="dropdown">
       <div>Radius: <?php echo $_POST['radius']; ?>
        <ul> <!-- Observe the change in data-val to data-val2 -->
          <li data-val2="10"> <a href="#" >10</a></li>
          <li data-val2="20"> <a href="#" >20</a></li>
          <li data-val2="30"> <a href="#" >30</a></li>
          <li data-val2="40"> <a href="#" >40</a></li>
          <li data-val2="50"> <a href="#" >50</a></li>
        </ul>
      </div>
    </div>
  </section>
</form>


Share : facebook icon twitter icon
Input Button not working on Jquery form

Input Button not working on Jquery form


By : user3779093
Date : March 29 2020, 07:55 AM
should help you out Your logic is flawed. You must not lower the flag (change to 0) if it's already raised (equal to 1). In addition, you should not directly call submit() again, just return true or false.
Fix with minimal changes to your original code:
code :
flag = 0; //lower by default
if (document.getElementById("user").value == "") {
    // slidedown some red css
    flag = 1;
} else {
    // dont show red css 
}

if (document.getElementById("email").value == "") {
    // slidedown some red css
    flag = 1;
} else {
    // dont show red css 
}
if (flag == 1) {
    // dont submit form
    return false;
}
else {
    return true;
}
jQuery form input into an array not working

jQuery form input into an array not working


By : Khaled Hassen
Date : March 29 2020, 07:55 AM
should help you out I'm working on a game and there is a form input where the user enters the number of characters. Once this happens more inputs appear for each character's name. My problem right now is reading those names into an array. , Try this way:
code :
$(".form").on('click', '#nameButton', function () {
    names = $(".newR").map(function () {
        return this.value;
    }).get();
    prompt(names);
});
jQuery Masked Input plugin not working on form input?

jQuery Masked Input plugin not working on form input?


By : jean
Date : March 29 2020, 07:55 AM
I wish this help you I have no experience of dataTables but from your code I think you are using the popup editor? If so you probably need to apply the mask in the event which is fired after the editor is opened like this:
code :
editor.on('onOpen', function () {
    $('#DTE_Field_phone').mask('(999) 999-9999');
});
Can't get jquery form input validation working

Can't get jquery form input validation working


By : Greg Sika
Date : March 29 2020, 07:55 AM
hop of those help? noob question... , You must load jquery in block
code :
<script src="//code.jquery.com/jquery-1.9.1.js" type="text/javascript">
<div class="imgform">
    <form>Login:
        <input type="text" id="imglogin" name="login">Password:
        <input type="password" id="imgpass" name="pass">
<a class="imglogin" href="#">Login</a>
            <div id="imgform"></div>
    </form>
</div>
$(window).load(function(){
$(".imglogin").click(function () {
console.log('working')
    var password = "111";
    if ($("#imgpass").val() != password) {
        $("#imgform").text("Incorrect password"); //I added div with id imgform
    } else {
        window.location.href = "http://google.com";
    }
});
});
jquery-form-validator.js: Form input validates, but form itself fails validation. Only one input in form

jquery-form-validator.js: Form input validates, but form itself fails validation. Only one input in form


By : Navvi
Date : March 29 2020, 07:55 AM
To fix this issue I'm using jQuery-Form-Validator and most of it is going fine. , You probably should remove this part:
code :
onValidate : function($form) {
          return {
            element : $( this),
            message : 'This input has an invalid value for some reason'
    }
}
Related Posts Related Posts :
  • clearvalidators not working in angular 6 form control
  • Remove Count Attribute in json data
  • queue up function callbacks
  • How to stop all Soundcloud streams in once?
  • Sliding div onclick left/right
  • RequireJS JQuery shim doesnt work with VS2013
  • What is the Meteor concurrency model?
  • Events on children of contenteditable element
  • Simple jquery not working to print the input value
  • Javascript templating language in reverse
  • Making Pagination in Javascript Scalable (for large # of db results)
  • Performance of Stateless Authentication in SPA and SSO (Single Sign On)
  • Assigning a value for view asynchronously
  • Mocha JS: How to reuse assertions within a spec?
  • Is ember.js stable enough to use in a real world project?
  • jQuery Load() not loading within div
  • encode stream from webCam h264
  • Regex to find pattern, return subpattern
  • Why does this regex to remove empty <p></p> tags from a string fail?
  • Rails: pass data to javascript
  • Quickest way to check if a number is in a set?
  • Phonegap events online/offline not working
  • In HTML5, please explain the meaning of '?' in the statement
  • Form to use AJAX rather than a page refresh but also utilise error handling?
  • JQuery Script looping error
  • different size divs align top left
  • Image fade-in when webpage finishes loading
  • Seeking HTML5 audio element causes delay (breaks sync)
  • How can I read & write data to a new tab in Firefox?
  • jQuery or JS turn all words into italic type
  • iOS css -webkit-transform: scale doesn't offset touch events
  • Populate select list using javascript
  • Can you work out why my .js file doesn't seem to be linking to my html?
  • Make slideToggle effect only one element at a time
  • Output sound using JavaScript
  • What is the analytics.js equivalent of _trackPageview found in ga.js
  • How can I check if a JS file has been included already?
  • hasClass and condition not working
  • EDITED: I'm having issues with a button and its function
  • Importing XML in HTML with javascript
  • Create new function in contentScriptFile in Firefox extension
  • Should I build Node.js from source or download the OS X installer?
  • How to enforce integer sizes in JS? (TypeScript?)
  • How to update the JSON object without deleting old values using javascript
  • Reading a javascript variable containing a string into another file
  • Possible to prevent 403 errors from logging to the web console?
  • Jquery Accordion - Expand and collapse div on hover
  • jquery .hide() function - Hide mobile, Display Desktop
  • Holding password in javascript variable - security implications?
  • JQPlot trouble to render vertical stacked bar and horizontal legend
  • counts days inbetween then add class to those days with nested divs?
  • Marionette.js with Rails (Devise) Authentication
  • javascript anonymous function evaluation idiom
  • Why am I losing the decimal when working this equation in Javascript?
  • Site redirects to index.php after being open while making calls to an API using AJAX
  • How to determine when multiple callbacks are all done
  • How to update Yeoman dependencies?
  • How can I do a /resolve with the Soundcloud Javascript SDK?
  • I'm not able to call a named callback function
  • How to get value of Paragraph element contained in <div> in HTML using JavaScript
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org