Data From Hidden Field Is Not Sent To Server...

Jul 23, 2005

I have a form whereby I can add multiple contacts to a single address.
There is only one firstname/lastname/telephone box - when the user
clicks the add button, I read the values from the form fields and
record them into a hidden text input field. This part works because
during debugging, I have converted the <input type=hidden> into a <input
type=text> to visably confirm my data is being copied into the 'hidden'
field.

Once the user has entered in one or more names, they can click another
button and submit the form for processing. My idea is that I would then
parse this hidden field server side...

I have a WAMPHP based server and as a test, I dump out my entire $_POST
(basically, the name and value in every INPUT tag).

My PHP script picks up the name of every input tag, including the hidden
field (like it should) but for some reason, the value that was written
to the hidden field is not passed to the server. Thus, for the PHP folk
reading this post, my hidden input field is called mylist and
$_POST['mylist'] exists, but its empty. Even though before processing,
I could visably see the input in the box (for debugging remember, I made
the input tag box a normal, unhidden one).

Here is what I have done to try and resolve:
- I have used both Mozilla 1.7.5 and IE6 - both provide same results -
my hidden field name gets passed, but not its value.

- I have created another hidden field and given it a default value ie I
have <input type="hidden" name="extraone" value="xyz"> and I get
$_POST['extraone']="xyz" passed to my php server, like I would expect -
however, the value of mylist is sent empty, even though it has data.

- I have even put in a javascript alert box just before the form is sent
to the server and can see the result in my (unhidden) box, and the same
value displayed in the javascript alert - but again, the value of the
mylist does not get sent to the server.


The only difference is that my hidden field (even if its displayed like
an ordinary text input box) does not post data written to form fields as
the result of a javascript function. Interestingly though, the server
does know about the input tag box since it does receive
$_POST['mylist'], it justs receives it empty.

What gives? If the form reads my input from one field, and writes it to
another field, then it should be sent to the server, true?

Also... my tags are all inside my <form></form> tag (which is proven by
double checking, and the fact that I do get the input tag box name sent
to my server).

Since I can see the data values in the box, it tells me my javascript is
doing what it should be doing - so I don't see any point in including my
javascript (though I have no problems doing so if someone requests
it). On the php server, I am using a simple phpinfo(); to check the
data is being received...

View 10 Replies


ADVERTISEMENT

Hidden Field To Store Data ?

Feb 4, 2010

I am using jquery to make a dialog box that take user info. I want to store that info and upload it to an sql database later. So far this is what i have.

<code>

When i run this i get:

Control 'ctl00' of type 'HiddenField' must be placed inside a form tag with runat=server.

View 1 Replies View Related

Hidden Field Being Populated With Data From Another Site?

Jun 29, 2010

I have a webpage for insurance agents that the agent will login and then enter some insured information.

There is a field named "agentnumber" that is on the form, but is hidden by a display:none. The field is set from the username of the person who logs in whenever the form loads the first time. The form will save automatically when the user leaves the page.

I am experiencing a weird issue that every now and then, the agentnumber field is getting saved with incorrect data. After discussing it with the agent, it is being saved with the agentnumber of the agent from other companies, not from the my website. what may be happening as I thought browser security would prevent cross site javascript. The users are using IE 7 & IE 8.

View 1 Replies View Related

<textarea> Data May Be Passed In A Hidden Form Field Or In A Cookie?

Mar 3, 2009

how <textarea> data may be passed in a hidden form field or in a cookie ? is needed any encoding ? in javascript ?

View 1 Replies View Related

Linking Text Field To Hidden Field?

Apr 2, 2009

I have created a html purchase request form that people will fill out and submit to make purchase requests within my company. In this html form, I have a text field that is automatically populated when the page is pulled up. The text field is populated with the name of the person who is logged in and it is read only so they cannot be deceitful or anything.To get to this HTML Request form, you must log in through a webclient thus the server knows to populate your name because you are the one logged in. The text field populates because of its <input NAME = "OBProperty_CurrentUserRealName", which is a keyword the program identifies and knows to populate with the logged in users name into that particular text field.

That works all fine and dandy, so here is where the problem lies. When submitting the overall form request, the populated name isnt being saved/ carried over to the admin page so we do not know who it was submitted by.To make the persons name carry over and save, another field name keyword must be used.

Which is OBKey__163_1. Which it was suggested to me to make that the input name of a hidden field. I need "text field A" to continue to populate the form with the persons name using OBKey_CurrentUserRealName, then pass the persons name off to a hidden field containing the input name=OBKey__164_1, which will thus save/pass the persons name on with the rest of the filled out request form when its submitted.

Here is what I have:

<input name="OBProperty_CurrentUserRealName" type="text" id="buyer" style="width:100%" readonly="readonly">
<input name="OBKey__163_1" type="hidden" id="OBKey__163_1">

View 3 Replies View Related

Use Onblur To Read Data From Field A And Place It In Field B

Aug 8, 2011

i have a form with a 'name', 'date', 'type', 'style', 'color' and 'result' field.let's say the user inputs "jones" in the name field, "8/1/2011" in the date field, "new" in the type field, and 'modern' in the style field.i want the 'result' field to take a look at the 'name' field, and if the 'name' field has a particular text, let's say (in this case) "jones", the javascript code will then place the contents of 'date', 'type' and 'style' fields, along with hardwired text like "the information you are looking for is 'date', 'type' and 'style'" into the 'result' field.

View 3 Replies View Related

How To Get Data From Server

Jul 23, 2005

What i want to do is that this function post data to the server (ASP) and
the server will response with 'OK' My question is how can i send data clientside from Javascript to the server ? (navigate ? with url ?)

and check the returned data in the same function ?

function ShowData(TxtArt)
{
alert(TxtArt + ' : ' + parent.frames.Bottom.TxtUsrName.value + ' - ' +
parent.frames.Bottom.TxtRemarque.value); // testing purpose
// post the data to the server. ex .. myURL.asp?userID=1000&Art=ART1201
// fetch the data from the server. to verify if the 'OK' is recieved ->
the server will response with 'OK'
// if 'ok' -> i will update clientside an frame (ex. contents of
shoppingbasket)
}

Any idea's ?

View 3 Replies View Related

JQuery :: Data Not Getting From The Server?

May 18, 2011

TEST .js

// JavaScript Document
$.post('http://example.com/test.php?image_no='+no_image, function(data) {
$('#gallery').html(data);

[code]....

View 1 Replies View Related

Return Data To The Server On The Fly

Jan 4, 2006

Read the first reply below first/instead, it's probably more helpful than this one

There's a lot of talk about AJAX these days and it seems to me it's turning into a hammer for a lot of problems that aren't really nails. If you want your pages to call home but don't want to have to deal with XML parsing and extremely spotty browser support, here's a very simple way to effect communication from Javascript to the server. The server can only (easily) communicate back on the next page hit with this method, but as a one way conduit from client to server post page rendering it can hardly be beat.

I've set it up with a really simple case that keeps track of the total time each user spends looking at a page in ten second increments. I have, for clarity (I hope) stuck it all in one PHP file, but it'll work the same with any server side language:


<?php
// this block isn't really too well coded or useful, it's intended more as a simple proof of concept
if (isset($_GET['ip']) && ip2long($_GET['ip']) !== false)
{
// if there's a GET variable (this.php?ip=something) and it appears to be a valid ip...
$fname = sha1($_GET['ip']) . '.time'
if (file_exists($fname) && strpos(($pre = file_get_contents($fname)), '='))
{
// if we have a file and it looks like it might be in the right format, increment the value contained therein
list($ip, $time) = explode('=', $pre);
file_put_contents($fname, $ip . '=' . ($time + 10));
}
else
{
// else just write it in and hope for the best
file_put_contents($fname, $_GET['ip'] . '=10');
}
/*
//actually returning an image here can help get the loading message out of browser's status bars

header('Content-type: image/gif');
fpassthru('small.gif');
*/
}
else
{
?>
<html>
<body onload="javascript:setTimeout('serverTick();', 10000);">
<script language="javascript">
var ip = '<?php echo $_SERVER['REMOTE_ADDR']; ?>' // give the javascript an ip or a hash or something to pass back that will be reasonably unique

function serverTick()
{
setTimeout('serverTick();', 10000); // call this function again in 10 seconds
var notshown = new Image();
notshown.src = '<?php echo $_SERVER['PHP_SELF']; ?>?ip=' + ip; // calls this file in attempt to preload an image, instead triggering the above block of PHP
}
</script>
</body>
</html>
<?php
}
?>


This will work in far more browsers than AJAX will, and it's not subject to any domain restriction, it can post to another server without generating security exceptions. It may be possible to get data back in the body of the image and it's definitely possible to get data back coded as image dimensions, if you want to push this method a little further.

View 5 Replies View Related

How To Load Data From Other Server

Apr 13, 2010

how Google Analytics or Google Adsense lets you copy and paste javascript to your site and you can load data/track visitors/etc. Well, I want to do the same thing for my customers, on their domains, where they load dynamic prices on my server (long story). Is $getJSON the best solution in this day and age? I would prefer to not force them to use frames and I am not worried (nor are they, for reasons I wont' get into) about users who don't use javascript.

In short, our site processes payments for them and there is a unique feature that offers dynamic prices. So if they have javascript code with an order button image, I want them to hit my server and have their javascript code read my server, find the updated price, and display it to their user. note they will be using .html pages, not php, and they are not programmers and I want to simplify it.

View 3 Replies View Related

Set Value Of Hidden Field

Apr 22, 2007

so I have a form page for a cart to checkout, on the first page, I am using the form action get and the page to pass the variables in the url to...

on the next page, I have grabbing some of them using the document.indexOf function...works great just using document.write(what is returned from the indexOf function); obviously, this just outputs the value in text, however, I need to set the value of a specific hidden field on the same page/form to that of what is returned by what I described above:

View 1 Replies View Related

Set The Value Of The Hidden Field To A Set Value

Oct 24, 2010

I am still learning jquery but I am wondering why this code does not work. I have a select field called item_name and a hidden field called amount. Based on the selection in item_name, I want to set the value of the hidden field (amount) to a set value. For example:

$(document).ready(function () {
$('#item_name').change(function () {
var value = $('#item_name').val();
if(value == "institutional memberhip"){
$("#amount").val("$349.00");
[Code]...

View 7 Replies View Related

Sending Data To Server With Iframe

Apr 5, 2006

Do you know a dynamic way to send 10kb of text or more using an iframe?

I tried to do that with by creating, in javascript, a dynamic iframe,
then create a form into this iframe and put the data in a textarea and
then call a sumbit(). Code:

View 1 Replies View Related

JQuery :: 1.5.1 Ajax Data Not Sent To Server?

Mar 3, 2011

I have the following piece of code:

$.ajax({
data: someData,
url: submissionUrl,

[code]....

where someData is a vanilla object of key/value pairs, submissionUrl is a valid URL and ajaxSuccess/ajaxError are both functions.Using jQuery 1.5.1, the GET request is delivered to the server without the data. Using jQuery 1.4.4, the request contains the data.Has something changed in the way I should be assigning data to an ajax request in 1.5.1? The docs don't seem to suggest I'm doing anything incorrectly.

View 2 Replies View Related

Posting Data To A Remote Server?

Sep 28, 2009

Here is what I am trying to do. On my web page, I have three choices for the user to pick from. After the user selects one of the checkboxes and clicks a submit button, I need to send a http request to a remote server to record the user's choices (actually it is an https that I am sending),.. so I need to send something like this.

[URL]

The remote server responds with an xml response that looks like this:

<?xml version="1.0" encoding="utf-8"?>
<sessionState>
<answer>True</answer>
</sessionState>

So, I want to post the request, read the response (answer) back from the other server and display it on my page. So, my dilemma is as follows:

1) my understanding is that I cannot do this with AJAX using an XMLHttp object because it is on a remote server and it would violate some sort of same-domain security. Is that correct? If in fact I can do it in AJAX, how do I read the response back from the other server?

2) if I am correct in my assumption in 1) then what is the best way to accomplish this task?

View 2 Replies View Related

Accessing Server Data From Within Page

Feb 3, 2011

what I am trying to accomplish is done through javascript, but I think that it is.

I would like to access server-side data without refreshing the entire page. Is this done through layers somehow?

View 2 Replies View Related

Fetching JSON Data To Server?

Apr 18, 2011

I am having trouble sending JSON data to a server. Its definitely reaching the parser.php, but I am not what to create in PHP to fetch this data. Also I am not sure my Javascript is correct.

<SCRIPT>
var JSONObject = new Object;
JSONObject.description = "hello";
JSONstring = JSON.stringify(JSONObject);
runAjax(JSONstring);

[Code]...

View 5 Replies View Related

Sending Data To Server Through Json?

Jul 27, 2011

I am trying to send the login info from a form into a IIS server and the asp file on the server will just respond back with the following text "Welcome, &name" on a ajax form on the client side. Currently, i am using a GET response and would like to send using JSON instead.

html file on client side

Quote:

<!-- AJAX component-->
<!DOCTYPE HTML>
<html>
<head>

[Code]....

View 5 Replies View Related

Hidden Field Two Jumps

Oct 6, 2006

I want to have a window pop up with a form. When the form is submitted,
it needs to pass along the URL of the original window. If find on th
web eight gazillion descriptions of how to pass data from one page to
another via hidden fields, but not a word about how to pass that data a
second time. Code:

View 2 Replies View Related

Assign The Value To A Hidden Field

Feb 21, 2009

Have a javascript in which i am trying to assign the value to a hidden field and getting the below msg:

I am getting the value in the alert box but not able to assign it o teh control

View 2 Replies View Related

Write Some XML Out So That It Is The Value Of A Hidden Field ?

Apr 9, 2009

I have a little bit of Javascript that runs fine, but I am trying to write some XML out so that it is the value of a hidden field. When I put it in the hidden field, it just shows the javascript instead of the value.

So, instead of showing the value of i++ it is showing <script>i++</script>

What I want it to show:

What it is showing

It works in the regular page, just not when I make it the value of the hidden form field. Sorry, kinda new to javascript.

View 4 Replies View Related

How To Check For A Hidden Field

Sep 21, 2009

I have the following hidden field within a form:<input type="hidden" name="test12" value="test12" />I also have the following function which does something if that field exists:

if(document.formName.test12.value == "thisdata")
{
//do something

[code]....

View 7 Replies View Related

Assign The Value To A Hidden Field?

Feb 21, 2009

have a javascript in which i am trying to assign the value to a hiden field and getting the below msg'document.Form1.H_ROWID' is null or not an objecti am getting the value in the alert box but not able to assign it o teh control alert("row " +M_ROWID)document.Form1.H_ROWID.value = M_ROWID

View 3 Replies View Related

Add Text To Div If A Hidden Field Value Changes?

Jan 20, 2010

I am currently working on a small Ajax image upload script using some clever iframes, php and a lytebox to create a seamless application. a small link on a page starts my lytebox that essentially opens a new page inside this. this page takes a file upload and using an iframe posts to a php script that will validate the file and upload to the server, the location of this file is then posted back to the iframe for viewing. Once this completes I have a cropping tool available for users to make final adjustments to their image before saving this and sending the new cropped image location to a value of a hidden text box. Once the user is happy with this they can click close to return to the parent page, upon doing this the value of the hidden filed is passed back to parent page and saved into another hidden filed to use. ( To clarify, i use hidden values as the parent page is the actual upload script.

My lytebox version was created to allow usability for users to re-size and crop their image before upload, all this happens in the lytebox to appear like its just a cropping tool.) Its at this point I am having some difficulty. I want to alert the user that the upload has been successful and all that is required is the user to hit save. This was ultimately save the finished image with all the users date in the database. I thought I could use an onchange event to trigger a function that would insert text into a div but this wont work. My code for the parent page and the hidden field is:-

[Code]..

View 1 Replies View Related

Select And Hidden Field With Same ID?

Mar 30, 2011

I saw this on a website, and I'm confused as to what the possible purpose could be for this.

Code:

<input id="myIDNAME" name="myIDNAME" type="hidden" value="0" />
<input id="myIDNAME" name="myIDNAME" type="checkbox" value="0" />

I thought repeating an ID would return an error.

View 3 Replies View Related

JQuery :: Json Reading Data On Server?

Jun 1, 2009

<div>Hi jQuery,</div>
<div> </div>
<div>I'm trying to learn the json and ajax</div>

[code]....

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved