Adding The File Submission?
Mar 21, 2010Im trying to add something to my web site, where a person can upload a file and i receive it through the email. how can i do that?
View 1 RepliesIm trying to add something to my web site, where a person can upload a file and i receive it through the email. how can i do that?
View 1 RepliesI'm working on a little project where they have a slider form and I need to piggyback a tiny line of code into the validation function for the form.
What I need to happen is when the user has filled in all the fields and clicks the submit button AND the data validates THEN a class is added to the body tag. My jQuery knowledge is very minimal - I added the code to where I 'thought' its supposed to go but it didnt seem to work.
jQuery(document).ready(function() {
jQuery('#scroller').css('overflow','hidden');
// Set up the scrollable registration
var wizard = jQuery('#scroller').scrollable();
[Code]....
I want to display a promotional message when the user clicks the submit button and before it goes to the server. The user must meet certain criteria in order to do this which is their postcode and I have written a regex for this -
/[TA]{2}[1-18|22|24]{2}/ I'm not sure how to incorporate this into my script. I have this so far.
[Code]...
I have email, password and some other fields, and I'm using $.post to send data for Ajax submission.
The problem is that I don't want to submit a particular field. The serializeArray() returns all the fields in the form. So, I tried something like this to prevent the password field being serialized.
This works great but the ajax submission doen't work.
I'm a photographer and my web designer is temporary unreachable at the moment and I need to urgently add hyperlink to my site. My site is html and currently I can add new things by editing an existing xml such as the following:
[Code]...
Now I would like to add a hyperlink to it, maybe on Sample description can be changed to Click to Visit with a link to it. I think the xml file is connected to a .js file so if it's relevant you can review the code here [URL]
I have this javascript that checks screen resolution and opens a custom css file depending on the results and its working fine if I run it from an html version of my site. What I want to try and do is add this script to my header.php file. header.php currently uses this code to define the css style:
Code:
<style type="text/css" media="screen">@import "<?php echo $this->getStyleSheet('style.css')?>";</style>
The javascript I want to use is in a file called detect.js that looks like this:
Code:
$(document).ready(function() {
if ((screen.width>=1400) && (screen.height>=1050)) {
alert('Screen size: 1400x1050 or larger');
$("link[rel=stylesheet]:not(:first)").attr({href : "style.css"});
}
else {
alert('Screen size: less than 1024x768, 800x600 maybe?');
$("link[rel=stylesheet]:not(:first)").attr({href : "style1.css"});
}
});
So heres what I tried but it didn't work instead it just loaded the page without a template.
Code:
<?php echo '<script type="text/javascript" src="jquery.js"> </script>';
?>
<?php echo '<script type="text/javascript" src="detect.js"></script>';
?>
I am trying to make it where someone can upload a .csv file, and I want to allow them to add multiple ones if they need more than the two that are already there.
What I did was add a div field:
Code:
<div id="fields" style="display: none;">
<p><label>File Field:</label><br /><input type=file name=file size=45 class=formfield /></p>
[Code].....
The problem with that is once they choose a file or two on those first two, then click the add a new field, it does add the new field so it works, but then the files they chose are gone, so now they have to rechoose them. every time.
I inherited a site that has jscript and html content. The site frame (top and left nav) are controlled by the jscript file. Most all of the content that is displayed when links or topics are selected is placed in the center of the page. I need to put some scrolling text in one of the top frame blocks, (the section that is java script file).
function buildMenus(){
var headerString = "";
var leftnavString = "";
var footerString = "";
[code]....
I have a couple of jscripts that do the scrolling I want, I just need to know how to insert it in the above section.
Any body succeed in adding file browser option to standard CKEditor developed completely with JavaScript.I have followed the link [URL]. it is too complex to understand.If any succeed with this or adding file browser option to simple notepad app
View 1 Replies View RelatedI'm a CSS and PHP developer, finding myself using jquery and AJAX more and more, of course, and learning a little about it as i go. but only a little. :o)i have a client who's asked me to add an image upload feature to a simple comments post script i've "built". i can see, kind of, how this jquery is posting the form text inputs, but have no idea if this thing can even be made to post a file at the same time.Hoping someone might add a function for me to do this if it can be done?
$(document).ready(function(){
/* The following code is executed once the DOM is loaded */
/* This flag will prevent multiple comment submits: */
[code].....
I'm having a few problems... none are caused by my browser, so they are proving hard to troubleshoot. A user has pointed a couple out to me.
I have this code as part of a script:
(I have inserted hard breaks to make the post look better)
----------------------------------
window.open("http://www.site.com/loading.htm","confirmation","screenX=10,screenY
=10,left=0,top=10,toolbar=0,location=0,status=0,menubar=0,scrollbars
=1,resizable=0,width=250,height=250");
document.subForm.submit();
----------------------------------
"subForm" targets "confirmation". The user is getting two windows instead of one. One contains the initial window document and the other contains the form action. Also, she says they are both big... the size (of at least one) should be 250x250. She is running AOL 6 and IE 5.5 on the related computer.
Perhaps a timeout would help the 2 window situation? Why are the windows big and not 250x250? If you know what's going on please let me in on it.
This same user has a laptop that runs AOL 4 and IE 4 (she thinks). On that computer the form is submitting to one window, but none of the data is making it to the new window. I am guessing this has to do with the way I have the "form" and "table" tags within the javascript document.write statements. Does anyone know a good web page on this subject? OR What else the problem might be?
Ok, next issue! I am trying to submit a form using Netscape 4.03. When the submit button calls the related function I receive: "subForm is not defined". Here is the line that is throwing the error:
----------------------------------
eml = subForm.email.value;
----------------------------------
The final problem is regarding the same form. When I hit the submit button in N6... nothing happens.
I've built a validation function which works great when you submit a form by clicking a button. However now I want to submit the form when the value of a input textbox changes. Actually it works fine to submit the form on the event onChange but it doesnt validate.
This is my code:
<form method="post" action="put_cart.asp" name="form1" return validera(this)">
<input name="product_id" value="<%=rs_mycart("Product_id")%>" type="hidden">
<input type="hidden" name="the_cart" value="yes">
<input type="text" name="quantity" value="<%=rs_mycart("Quantity")%>" size="3" >
</form>
With a form in a doc like
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
[code]....
Why does no alert happen no matter what is in alert? Even when I can with other variations, I can never get an alert that shows the number that is typed in the input box, eg. 17? I seem not to be putting the right script in the right place or am confused. I have read so many tutes too and tried all sorts of things. Can someone kindly explain how you actually and practically get a typed number input to fill a variable and be verified either in an alert or in a write. Or a brief simple explanation of the process.
Is there a good way to use JavaScript to send a form submission, but get
back the response as a string, rather than loading it into a page? I
could write the code to send the submission via XMLHttpRequest, but that
seems hard... especially implementing multipart-encoded form submission
such as required for file upload.
Is ther anyway i can automatically fill out forms and submit them thru
java?
supposing i hav a normal txt file that contains all data that needs to
be filed out into the form, is there anyway i can fill out a form and
submit it automatically by providing only the URL of the form and the
txt file?
I'm working on a project for my company that will be deployed next week. In a nutshell, we have a bunch of touchscreen computers that we are using as kiosks for an internal event. The various screens have been build in XHTML/CSS, with a smidge of javascript for the few points of interactivity that aren't being handled through the HTML.
I just started dabbling in Javascript for this project about a month ago, and I think with enough time, I could probably figure this out. But I'm feeling crunched on time, and I thought someone here might have a simple solution.
So here's where I am. The "boss" doesn't want to use the built in browser alert/prompt boxes, which is fine by me, since I can just skin up some alerts in CSS, and attach JS functionality to them. But I ran into a snag in one of them. On each kiosk, we are placing a transparent DIV in the upper corner that invokes a password prompt. If the password matches the password stored in the JS, the kiosk browser window closes (window.close). If the password doesn't match, the user is informed of such, and remains in "kiosk" mode.
For the password box, I've written in a hidden box in CSS, who's display value is set to visible when someone hits the hidden area in the upper corner. That works fine. The box itself is a <p> that simply prompts the user to enter the password to continue. I have a form with a text field as well as an "ok" button.
Here's where things stop working. If I pre-define the value of "var password" to be the correct password, clicking the OK button works as expected. But if I try to use the user input from the form, I get an error. I'm happy for someone to start me from scratch if the below code isn't workable. Here's what I need:Password prompt box that's skinnable in CSS.Value checked against stored variableIf accepted, window closes.If denied, user is informed and prompt box is returned to hidden state.
[Code]...
One note, before I toss this to you all. If it's easier/better to simply include the error message as part of the FORM, instead of it's own separate box, I'm A-OK with that.
I'm using simple form validation, found online, to check certain fields before submitting. The problem is that, although the script detects the error/missing field/wrong syntax and pops up the corresponding alert, after the user presses OK in the alert box the script continues and sends the form - which of course is not valid.
HTML PART:
<input name="Submit" type="submit" class="textfield" value="Register" onclick="checkitems();">
JAVASCRIPT PART:
function checkitems() {
valid = true;
if ( document.registration.Onoma.value == "" ) {
[code]....
I have the following:
function search(text) {
address = "/cgi-bin/room.cgi?" + text + "-search" + "-1";
location.href=address;
}
<input type="text" id="query" name="query" size="17" maxlength="32"
[Code]....
Works perfectly in IE. In FF or Chrome works fine when I click the button but not when I press "Enter".
user fills in a form (selects files for upload, writes a post, etc.) and submits it - without page reload she gets a response from server (error, unsupported file type, inappropriate language, success, etc.)I imagine first, submit-without-reload, part is done via the form.target property like this: - iframe is either created dynamically with JS createElement or statically. But in any case it should look something like this:
<iframe id="#iframe123456" name="#iframe123456"></iframe>
- form, also created either dynamically or statically:
<form action="process.php" target="#iframe123456">
<!-- inputs of various types -->
</from>
As for the response/result part, server dumps its reply into the targeted iframe, so I have three alternatives:- use iframe's onLoad (onReadyStateChange) event: attach a get_data() function to it.- frequently/manually poll iframe for data using setInterval(get_data, milliseconds). - inject some script into the server response that makes iframe itself call get_data() .how I can check if an iframe has data in it.I use the following script to get the iframe's inner document object (excerpt from get_data() fucntion ):
if ( iframe.contentDocument ){
doc = iframe.contentDocument;
}else if( iframe.contentWindow ){
[code]....
I am trying to validate a form field using a $.post request and am having an issue with timing because of the synchronous property of the post I assume. If I put in an alert, it works fine because the post has returned in time to stop the form submission. Here is the original way I did it but the form is submitting before I can send the return = false.
Code JavaScript:
$('form#form-oidupdate').submit(function(e) {
var srchstr = $('form#form-oidupdate input').val();
var passdata = {'type': 'availability', 'srchstr': srchstr};
[Code]....
i have a form that has both front end and backend validation (php)
basically i got the code off the net, and it needs the submit button to be of type "button" rather than "submit"
and obviously the form doesn't submit if javascript is turned off
i'm not a javascript expert, on the button it has onClick="formvalidate())"
and in the javascript it has
if form is ok form.submit() or something to that effect
now is it possible to use a submit type so that if javascript is turned off, the form will still submit
but won't submit if javascript is on and the form is invalid
does it have something to do with the onSubmit attribute for the form
currently there is none
because we have the backend validation it doesn't really matter if javascript is turned off but it does matter if the form can't even be submitted at all
On one of our pages, when the page loads, the form submits. The only problem is, we need the submit name to be name="submit". When we use this, the form doesn't autosubmit. When we use something like name="submit1", it submits, but our form doesn't work properly, since it's requiring the submit name="submit".
<html>
<body onLoad="document.loginForm.submit();">
<form action="index.php" method="post" name="loginForm" id="loginForm" >
<input name="usrname" type="text" value="theusername">
<input name="pass" type="text" value="thepassword">
<input name="domain" type="text" value="somedomain">
<input name="submit" type="submit" value="Login">
</form>
</body>
</html>
Any ideas how we can still auto-submit, but use the submit's name="submit" parameter?
I have an online form for doing proofs and have a problem: My form page collects all the information the user has entered. the form has 2 buttons
When you press the PREVIEW button I need the form submitted to open a new _blank page. This page shows a pdf with the info in. This is so the user can close this page down and still have the forms screen behind to make any changes.
When the user presses SUBMIT I need the form to submit to a _self page so that the form page becomes a thankyou page and the user cant make anymore changes to the details he has submitted.
The forms must submit as the online pdf proof wont work without a submission.
I have a very basic postcode validation script which works brilliantly, however I require a new validation adding to this. I want to single out people with specific postcodes, to be mor specific anyone with a Milton Keynes postcode should receive an alert when they submit the form before it goes to the serverside action page.I can write a regular expression which detects the postcodes i want to look for, however i am lost as to how i create an alert before the form is submitted without cancelling the submission.My current validation for the postcode looks like this:
Code:
var regExpressPostcode = /^([a-zA-Z]){2}([0-9][0-9]|[0-9]){1}([ ])([0-9][a-zA-z][a-zA-z]|[0-9][0-9][a-zA-z][a-zA-z]){1}$/;
function checkForm(aForm) {
if (!regExpressPostcode.test(aForm.shipPostalCode.value)){
[code]....
I'm trying to prevent the submission of a form but it apparently isn't working.
Code:
elForm.onsubmit = function(){
object.GoAJAXGo(elForm);
return false;
}
The return false bit I believed would prevent the submission.
I have a form which houses basic inputs, as well as a few multiple select forms.
I need to parse all the 'values' which are in this multiple select form (it
gets manipulated dynamically client side). I wanted to create a function
that loops through all the form elements, and if the type 'select-multiple'
is detected, gather the VALUES of each <option> inside it.
The bit I'm stuck on is then how to reconstruct this into a form submission.
Preferably I wanted the data from the 'select-multiple' element to be
submitted as comma delimited, eg 14,12,512,63,62 which would later be parsed
by PHP.
I was considering reconstructing a query string and submitting that as GET,
but I'd prefer to POST it along with the other data (such as INPUTS etc)
which do not need to be changed.
Can I somehow attach some 'hidden' type data onto the end of the form
submission at this point?