Automatically Submitting A Url To A Translator
Mar 31, 2009
I'm a novice in javascript programming. I need to create a program that automatically sends websites to a free translating site (the part where it asks you to input a url for website translation), and automatically redirect the user to the translated site. I basically just need to know how to send the url to that box, and submit the result, and redirect the user there.
View 2 Replies
Jun 2, 2001
This maybe a simple question, but I've never had to do it before.
How do I automatically submit a form, preferably with JavaScript?
I have a form with an action attribute to where to send data, some hidden fields and some radio buttons with default values, a submit button at the bottom, and a javascript timer that starts on the body onLoad event. The trick is that when the timer runs out, I want the form automatically submitted.
View 2 Replies
View Related
Jan 31, 2010
I'm sure this is really easy, but I can't get it to work
I'm trying to submit a form full of hidden fields automatically when the page loads. I don't have access to the <body> tag, so I'm trying to add the auto submit with javascript. (jqeury)
I've got so far:
Btw this is within a wordpress page.
I've tried the regular "$(document).ready(function() {" as well.
View 23 Replies
View Related
Aug 22, 2002
Don't know if there is one of these online, so I made me own. Simple function that outputs a number as words. First argument is the number, second argument is flag (default = false) that controls whether output is cardinal or ordinal - as in "one" or "first".
Goodness knows if I have the grammer correct, especially when the numbers get big. Enjoy!
LIMITS:
1) Doesn't work with WebTV or below NS 4. Changing the large literal array into a common array should fix that, but I didn't bother.
2) Converts number into an integer before wording number. So, no "one point forty-five" stuff. This function is a good start for anyone who wants to do that though.
3) Always returns, "zero" for 0. Couldn't find cardinal equivalent to "zero"... zeroeth?
/*
Num2Word, ouputs written number in human language format
ARGUMENTS:
-----------
Nbr: num, the number to be worded. This number is converted into an integer.
Crd: bol, flags whether output is cardinal or ordinal number. Cardinal is used when describing the order of items, like "first" or "second" place.
*/
function Num2Word(num,fmt) {
//_ arguments
num = Math.round(num).toString(); // round value
if (num == 0) return 'zero' // if number given is 0, return and exit
//_ locals
// word numbers
var wnums = [['hundred','thousand','million','billion','trillion','zillion'],['one','first','ten','','th'],['two','second','twen',0,0],['three','third','thir',0,0],['four','fourth',0,0,0],['five','fifth','fif',0,0],['six','sixth',0,0,0],['seven','seventh',0,0,0],['eight','eighth','eigh',0,0],['nine','ninth',0,0,0],['ten',],['eleven',],['twelve','twelfth'],['thirteen',],['fourteen',],['fifteen',],['sixteen',],['seventeen',],['eighteen',],['nineteen',]];
// digits outside triplets
var dot = (num.length % 3) ? num.length % 3 : 3;
// number of triplets in number
var sets = Math.ceil(num.length/3);
// result string, word as number
var rslt = ''
//_ convert every three digits
for (var i = 0; i < sets; i++) { // for each set of triplets
// capture set of numbers up to three digits
var subt = num.substring((!i) ? 0 : dot + (i - 1) * 3,(!i) ? dot : dot + i * 3);
if (subt != 0) { // if value of set is not 0...
var hdec = (subt.length > 2) ? subt.charAt(0) : 0; // get hundreds digit
var ddec = subt.substring(Math.max(subt.length - 2,0),subt.length); // get double digits
var odec = subt.charAt(subt.length - 1); // get one's digit
// hundreds digit
if (hdec != 0) rslt += ' ' + wnums[hdec][0] + '-hundred ' + ((fmt && ddec == 0) ? 'th' : '');
// add double digit
if (ddec < 20 && 9 < ddec) { // if less than 20...
// add double digit word
rslt += ' ' + ((fmt) ? ((wnums[ddec][1]) ? wnums[ddec][1] : wnums[ddec][0] + 'th') : wnums[ddec][0]);
} else { // otherwise, add words for each digit...
// add "and" for last set without a tens digits
if ((0 < hdec || 1 < sets) && i + 1 == sets && 0 < ddec && ddec < 10) rslt += 'and '
// tens digit
if (19 < ddec) rslt += wnums[ddec.charAt(0)][(wnums[ddec.charAt(0)][2]) ? 2 : 0] + ((i + 1 == sets && odec == 0 && fmt) ? 'tieth' : 'ty') + ((0 < odec) ? '-' : ' ');
// one's digit
if (0 < odec) rslt += wnums[odec][(i + 1 == sets && fmt) ? 1 : 0];
}
// add place for set
if (i + 1 < sets) rslt += ' ' + wnums[0][sets - i - 1] + ' ' // if not last set, add place
} else if (i + 1 == sets && fmt) { // otherwise, if this set is zero, is the last set of the loop, and the format (fmt) is cardinal
rslt += 'th' // add cardinal "th"
}
}
//_ return result
return rslt
}
Test the result of various valies like so
for (var i = 0; i < 50; i++) {
var x = Math.round(Math.random() * 5000000);
document.write(x,' -> ' + Num2Word(x).bold(),'<BR>');
}
Use this function towards whatever means you deem necessary. Pease credit me, Bemi Faison, if you use this script.
View 3 Replies
View Related
Feb 4, 2011
I have developed my own fake language like pig latin but ever so slightly different, I want to make a translator for it as there are so many for pig latin,english-my language:
1: put the first letter at the end (hello becomes elloh)
2: put an 'a' 2 letters in (elloh becomes elaloh)
obviously if the inputted word had a capital letter at the begining, then the new first letter should be in capitals, and the translator should be able to translate whole sentences not just word by word,I have downloaded countless javascript/html files for pig latin translating because obviously the first step for translating to the 2 languages is the same and ive managed to stop it adding the 'ay' or 'way' to the end of the word as it is in pig latin bu i dont think ive done it very efficiently?
View 1 Replies
View Related
Nov 21, 2010
Imagine the following input:
Code:
<form action="search.php" method="get">
Search: <input type="text" name="search" />
<input type="hidden" name="searchOriginal" value="search" />
[code].....
What I would like to do is: Use google AJAX API to see if the search string (search) is different of english. I would like to translate it and send it like that to search.php. So it would appear already translated like this in the URL: search.php?search=translatedString. And search.php would also see it translated.
View 6 Replies
View Related
Nov 11, 2005
I use the following code to submit a form to a pop-up window:
<script>
function cForm(form){
win=window.open('','myWin','toolbars=0');
form.target='myWin'
form.action='http://msn.com'
}
</script>
<form name="sampleform" method="POST" action="/cgi-bin/formsubmit.pl">
<input type="text" name="q"><p>
<input name="button" type="submit" value="New" </p>
</form>
It's designed to run only on PCs running windows 2000 + and IE 6. I have tested it on several PCs without encountering any problems. However, when I run it on my own PC the pop-up simply loads an about:blank page and the action page opens in a new window, so I'm left with 3 windows instead of 2.
View 2 Replies
View Related
Jul 23, 2005
I'm supporting an ASP legacy application and need to implement
"autosave" functionality. I have two frames, one that holds tabs
displaying different pages a user can select, and the other that holds
the page content itself. If a user clicks on another tab without
clicking the Submit button, I want to submit the current form for them
and do some further processing.
The problem is that top.framename.formname.submit() only works
sporadically. Sometimes the document object of the page frame does not
exist. Is there any way to "guarantee" that the document object will
exist? Has anyone ever encountered this problem or have any suggestions?
View 14 Replies
View Related
Jul 20, 2005
I have a page which contains a form.
I want a customized button with an image for the submit button, and when the
submit button has been clicked send the form to the perl script.
Now the form is no problem but the button is, so the question is how do I
create a custom button and how do I submit the form with javascript when the
button is clicked?
View 15 Replies
View Related
Sep 5, 2009
I have a form with 36 checkboxes.if all the checkboxes are selected the URL will be
myURL/form.php?checkbox1=value&checkbox2=value&checkbox3=value........ and so on. it will be a very long and ugly url.Is there any way I can make it so that if all checkboxes are selected the URL will just say myURL/form.php?checked=all.
View 5 Replies
View Related
Feb 19, 2011
I'm trying to submit form data to mysql. The POST form action calls the .js file, which make a request to the http server, which connects to the database, executes a php script via URL and submits data to be entered. The php script executes inserting data into database, then redirects the page following execution of script. After, submitting the form, the page redirection in the php script works but no data is entered. Trying to figure out why. Here is my httpRequest.
Code:
function submitPrefs()
{
var URL = './PHP/submitPrefs.php';
var xmlhttp=false;
[Code]....
View 1 Replies
View Related
Jul 21, 2009
I've setup a form on my website and added a simple validation script to check a few of the fields. After all the validations are done I want the submit button to process two other functions that will handle the submission of the form.
The problem is that if the validation returns true the script just stops and doesn't run the other two functions.
Here is my validation script:
Then on my submit button I have:
View 10 Replies
View Related
Oct 18, 2009
I have a form that has some fields and inputs . I wrote some javascript code that if there was any problem with entered values , it shows the errors but when the user press submit button , the form submited before it had shown the problems .
View 1 Replies
View Related
Jun 14, 2011
I am trying to automatically submit a form in an iframe with javascript. My question is whether this is possible or not, and if so how the code should look like to submit the form in the iframe?
this is the form within the iframe that I am trying to submit automatically:
<form id="Form2051051" action="nieuw-bericht.2051051.lynkx" method="post" class="form" onsubmit="return ProcessForm( 'Form2051051' );">
[code]....
View 1 Replies
View Related
Jan 9, 2007
This functions great, but when the form is submitted the fields that rely on the script are not transmitted. I am using FrontPage for my forms and would like to continue, if possible. The fields "Option1" & "Option2" are the fields that aren't being submitted correctly. If I don't select these options then EMPTY is submitted, correctly. If I select a value such as Topic1, then the form is submitted with the answer blank. Code:
View 2 Replies
View Related
Mar 3, 2011
i am submitting a form in javascript and i want it to submit on key press submit, but it wont work. here is my code:
<script type='text/javascript'>
function login(evt){
if (evt){var keyCode = evt.which ? evt.which : evt.keyCode;}else{keyCode='';}
if ((evt == '')||(keyCode == 13)){
[Code]...
View 5 Replies
View Related
Jul 23, 2005
I have a simple form with 2 password field . when a use click submit ,Javascript will check whether
two given password are same or not .If not it will show alert message . I wrote the script like
------------------
if (formr.pword1.value != formr.pword1.value )
{ alert("Password not mached.")
formr.pword1.focus()
return false
}
----
View 1 Replies
View Related
May 5, 2010
I have the following code...
It's not showing me the alert. I'm just trying to get that part to show it works. However, what I'm trying to do is add up the values in one and two and the based on adding those two up and then placing that total in the total field. Any ideas on how to do this?
View 2 Replies
View Related
May 23, 2010
I have a form in which there are two buttons,input type of button1 is Submit and button2 is button.
<form name="myForm" method="post" action="two.jsp">
<input type="submit" name="btn1" value="Test1">
<input type="button" name="btn2" value="Test2">
</form>
I am calling a javascript on click of button2.
<script type="text/javascript">
function jump(){
[code]....
After closing the popup window which is opened against button2, if I click button1 then it will open the same popup window.
View 3 Replies
View Related