Passing Field Value To A Php Page
Feb 12, 2006
I am trying to pass the value of a field to a PHP file like this:
<input type="hidden" name="field1" id="field1" value="123">
<input type="hidden" name="field2" id="field2" value="456">
<a href =
"test.php?c1=document.getElementById('field1').valu e&c2=document.getElementById('field2').value[color=blue]
><img src="add.gif" border="0"></a>[/color]
In test.php, when I do:
c1=$_GET['c1'] ;
echo c1;
I get:
c1 = document.getElementById('field1').
View -1 Replies
ADVERTISEMENT
Nov 19, 2011
I am new to JS and usually learn by studying code posted online and modify it to have it do what I need. Recently, I used a totaling plugin for an online ordering form which does the below:
item1 qty(user input text) * preset price = total price
item2 qty(user input text) * preset price = total price
item3 qty(user input text) * preset price = total price
[code].....
View 1 Replies
View Related
May 9, 2011
I want to write a generic function since I'm basically doing the same thing over and over. What I'm trying to do is to pass the name of the form and the specific field name to complete the following line: "var testdata = document.form.input.value;".
[Code]....
View 1 Replies
View Related
Apr 2, 2010
I have a function that gets the value of a clicked on <span> like this:
function getSelectedValue(id) {
return $("#" + id).find("dt a span.value").html();
}
and sets the value of a second span like this:
$("#state").html("value: " + getSelectedValue("state"));
When I echo that second span, I get the selected value from the first span. But I need to get that value into a hidden html form field, so I can pass it along with the $_POST array. How do I do this?
View 5 Replies
View Related
May 27, 2004
I have a bunch of forms in my page, and want to pass a reference to the current form to a javascript function - when, say, a user clicks on a particular element. Normally, within any type of input field, I'd just add something like this:
onclick="my_function(this.form)"
Then, in my_function( form ) I could refer to form. No worries.
But here's the interesting bit. I also want to run the same function when the user clicks on any <a> tag within a form, like:
<a href="javascript: my_function(this.form)"> ... </a>
Problem is, with this code, the form reference isn't passed to the javascript function. the "this.form" bit doesn't work...
I find this rather curious. So the question is, how do I pass a reference to the current form from within a non input field?
View 5 Replies
View Related
Oct 20, 2009
I have an email which has some values attached to a link in the email that get passed to an online form on a website when clicked. Problem is the value is a price and the string includes a "$" which I need to remove. I've read through many examples and everyone seems to have an opinion (surprise). One suggests something like this: text2.value=text1.value.replace(/$/g,""); While someone else says its better to remove what you don't want. I am also scratching my head over should I place the value into a hidden field, scrub it then copy that into the proper field? and I imagine the best way would be to run it with an "onload" command instead or a event handler like a keystroke since the field is not typed?
View 4 Replies
View Related
Oct 14, 2010
I'm having trouble detecting if there is value in a field when the page loads and manipulating the fields label class accordingly. Below is my code. I'm using it to display the field label inline with the field, and when the user starts typing, the label is hidden. The problem I'm having is, since this is for a login screen, if the user has typed in an incorrect password, the username still remains entered when the page reloads and I see my label stacked underneath.
How can I detect if that field has a value and apply a class to the label to hide it? I don't have to have to specify each field by their ID, because I'd like to use this all over (member profile management area).
[Code]...
View 7 Replies
View Related
Jul 31, 2009
I've been searching for a few hours and haven't been able to find a code snippet to see if this is available. I'm attempting to pass text from my website to another website that has a form setup on it. I'd like to fill in the pertinent data for my users on the page that I load for them. I cannot make any changes to the receiving page as it is run by another company. I've pasted some of the code that is available on the receiving form.
<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
[Code]....
View 5 Replies
View Related
Jul 23, 2005
My code works but because I'm using VBscript within JavaScript I get an error
message...the yellow tri-angle with an "!" mark.
---------------within my body-------------
<script language="JavaScript">document.write(formatCurrency(<%=Request.Form
("total")%>))</script>
------------------------------------------
My script takes the form element "total" from the previous page and sends it
to a function for formatting. Problem is...JavaScrip just doesn't like
VBscript. How do I get the form element using JavaScript?
View 3 Replies
View Related
Jan 29, 2009
i have a hidden filed with a value want to pass this value frm one page to another using
[Code]....
in second page i have used request.form("field name") but getting balnk
View 1 Replies
View Related
Sep 8, 2005
I am doing this:
window.location="page2.php?subj="+subj+"&body="+body;
to send information to another page.
However, I don't want that second page to show up or display in any way.
There is only behind-the-scenes work going on in that page.
How do I pass the information to that page so that it is only processed and
does not launch a window?
View 10 Replies
View Related
Aug 7, 2006
I've been Googling & can't find a consistent cross-browser (IE & Firefox) answer to this...
I need to pass some data from inside an iframe, to the parent page
I've got the parent page PAGE1.HTM which contains:
<div ID="mydata"></div>
:
<iframe src="page2.htm"></iframe>
And, inside PAGE2.HTM I will set mydata to a hard string. But in page2.htm do I do
var parent.document.mydata.innerHTML = "my data here'
or
var window.parent.document.all.mydata.innerHTML = "my data here"
or something else...??? to be cross-browser compatible (IE and Firefox mainly).
View 1 Replies
View Related
Jun 10, 2011
I want to pass 2 variables from a html page and collecting in another html page using javascript. Say I pass xyz and abc to a page 2.html from 1.html without using cookies. In 1.html page i have many links. each link should be able to pass different variable to 2.html. When some one clicks on a link the variables should be passed to 2.html. I want to know how to collect them and use them.
View 4 Replies
View Related
Mar 30, 2011
i'm doing my FYP, and facing the following problem.below is my code for the javaScript
<script language="JavaScript">
function deleteAccount(ckId){
alert(ckId);
[code]....
View 1 Replies
View Related
Jul 15, 2011
I'm trying to build a store locator and trying to figure out how to pass an input value from one page to another page. User would input their zipcode or address in a form on one page and the map and locations would be called on another page using the input. I'm using ehound store locator platform (sample - here -> [URL] The map/locator script is this
[Code]...
I've looked around on passing inputs via php and such, but this script seems to call on javascript as well and I'm having trouble implementing anything that works.
View 5 Replies
View Related
Sep 17, 2006
What I want to do is: On a site, when a viewer hits the 'contact us' button, a new page opens with a contact form which will in turn be submitted to a php script on the server.
I want to pass the url of the page that called the form to the php script in a hidden field, so that when the php form handler emails me the form result it tells me what page the viewer was on when they hit the contact me button, and then after that I want to send the viewer back to that page,
In a page I can get the page url using js to get location.href and place it in a variable. But after calling the form page I don't see how to put that variable which I think is global(?) into a hidden form field to post when the form is submitted.
Once it is at the server I have no trouble with the php to do what I want, I just can't see how to get the javascript variable to persist across site pages.
View 9 Replies
View Related
Jun 17, 2011
why this is not passing my values?
Code:
myloc="http://owl.ncl-coll.ac.uk/misc/Intraining/Employability_Resources/Confidence/E3_L1_Overcomoing_Hurdles/pages/actionplan.htm?
[code]....
View 12 Replies
View Related
Jul 27, 2011
how do I pass url value to iFrame inside the same page, for example: I would like to pass [URL] to iFrame where is the function displaying all the items with value = 1. This is all on the same page.
View 1 Replies
View Related
Nov 2, 2011
Problem I am having regarding passing data to new page ?
View 2 Replies
View Related
May 4, 2011
how do I use a query string to pass a image that a user selects from a number of images to a second page where the selected images will be displayed as a slideshow?
View 15 Replies
View Related
Apr 7, 2010
However, there is one problem that I just can not figure out. I have 3 arrays storing information on page1.htm, this is all well and good, but I want to use the data stored in those 3 arrays when the user moves to page2.htm.
View 1 Replies
View Related
Nov 27, 2009
This script and code works great, but in order for me to finish, I need a way of passing to the next PHP page which check box is checked. Currently, it is just passing a single value (1, 2, 3, 4, 5, or 6) depending on the last box checked. I need a way to record which check boxes are selected.
<html>
<head>
<script type="text/javascript">
var majors = {
"001 - Exchange"
[code]....
View 9 Replies
View Related
May 24, 2010
I want a page with a hyperlink that passes a variable to another 'pop-up' page (in this case a name, its just an example) and new pop-up page prints a message followed by the variable thats passed.
Here is the code as it is right now
<html>
<head>
<script language="javascript" type="text/javascript">
function popitup(a)
[Code]....
In short, I just want the pop-up page to print 'Hello there Toby' or whatever name I choose to pass across. The 'testpopup.html' url is just the initial webpage.
View 2 Replies
View Related
Dec 1, 2010
I am passing parameters from one page (actually from a frame within a frameset) to another using Javascript. Typically the code is as follows, taking values from a Form.
parent.titleFrame.location="frm_right_demo_title.html?MyDateEvent.value='"+ytt+
"'&MyParam_spec.value='"+parent.mainFrame.document.forms.myForm.MyParam_spec.value+"'";
This has worked fine in all browsers including IE, Chrome and Firefox version 2.0.0.2.
However, I have now found that it doesn't work with Firefox version 3.6.12.
This is because when retrieving the parameters in the new loaded page, the character ' (quote) has been converted to %27 (percent twenty seven).
I can write code to replace %27 with the quote character. However, this is lengthy and time-consuming (as I need to have cyclic code as the javascript replace command seems to work only on the first occurrence within a string).
View 7 Replies
View Related
Oct 27, 2003
I have a fairly complex javascript object - containing strings and arrays - which I need to pass along to a second PHP page. Is there a way to pass this object along via POST to be picked apart by the receiving PHP script?
I could dynamically create a form, populate it with the contents of the object, then pass it along via submit(), but frankly that's an awful pain.
View 4 Replies
View Related
Jan 27, 2010
i just wanted to know how to pass values from one webpage to other webpage.i have this textfield in the form whose value is going to be same in all the webpages.so when i put this value in my first web page it should come in other web pages automatically how to do that?
View 2 Replies
View Related