droidus's Profile
Reputation: 0
Apprentice
- Group:
- New Members
- Active Posts:
- 10 (0.03 per day)
- Joined:
- 29-April 12
- Profile Views:
- 93
- Last Active:
May 09 2013 09:45 PM- Currently:
- Offline
Previous Fields
- Dream Kudos:
- 0
Posts I've Made
-
In Topic: submit form
Posted 1 May 2012
oh yea... i meant ==. sorry 'bout that. but it still is not showing the popup when i leave the fields empty -
In Topic: submit form
Posted 1 May 2012
but it gives me an error when i use this:
if($('#title').val()='' || $('#description').val()='') -
In Topic: submit form
Posted 1 May 2012
I thought that "," meant or? i know in php, it's ||. what is it in jquery?
and what I am trying to do, is check if title is empty OR description is empty. -
In Topic: submit form
Posted 1 May 2012
I just wasn't sure if you had to call on something to process the form or not.
so then with the php, we would say that the user has javascript disabled, and that would be our backup plan to validating everything?
Lastly, what am I doing wrong here?:
$(function() { $("#fileUpload").submit(function(e) { flag = false; if($('#title').val()='',$('#description').val()=''){ flag = true; } if (flag) { e.preventDefault(); alert("Validation failed!"); } else { alert("bad"); } }); }); <form enctype="multipart/form-data" name="fileUpload" id="fileUpload" action="processUpload.php" method="post"> <input type="submit" id="submitUpload" name="submitUpload" value="Upload" /> //... -
In Topic: submit form
Posted 1 May 2012
oh... i see! so I have to intercept it... so how do I submit it if everything is ok then, with the jQuery?
and so if the user has javascript disabled, the form still submits with the php page...
My Information
- Member Title:
- New D.I.C Head
- Age:
- Age Unknown
- Birthday:
- Birthday Unknown
- Gender:
Contact Information
- E-mail:
- Private
Friends
droidus hasn't added any friends yet.
|
|


Find Topics
Find Posts
View Reputation Given
|
Comments
droidus has no profile comments yet. Why not say hello?