This.Sven This.Sven - 1 year ago 103
jQuery Question

JavaScript .not ignores the parameters

I want to validate all my inputs except the file uploader input. If I use

.not($( "#uploader" ))
it does ignore anything below I've written.


<div id="formularDiv" class="sampleFormStyle">
<div class="wrapper">
<h2><?php echo 'You\'re applaying for '.strtoupper($_GET['page']);?></h2>
<form id="formularID">
<input id="firstName" name="firstName" type="text" placeholder="First Name:"/>
<input id="lastName" name="lastName" type="text" placeholder="Last Name:"/>
<input id="street" name="street" type="text" placeholder="Street:"/>
<input id="postalCode" name="postalCode" type="text" placeholder="Postal Code: " />
<input id="place" name="place" type="text" placeholder="Place: "/>
<input id="telefone" name="telefone" type="text" placeholder="Telefone: " />
<input id="email" name="email" type="email " placeholder="Email: "/>
<label id="uploader" for="uploadFile"><i class="fa fa-cloud-upload fa-2x fa-fw" aria-hidden="true">Upload</i></label>
<input id="uploadFile" name="uploadFile" type="file"/>
<input id="submitForm" name="submitForm" type="submit" value="Submit"/>


$('#formularID').submit(function() {
//some code that's working without .not()

I appreciate every help!

Answer Source

Try this. As per your html, the id of the input that you want ignore is uploadFile not uploader

$('#formularID').submit(function() {
                 //some code that's working without .not()
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download