PHP : Reselecting After $_POST?
May 28, 2011
I'm using the following PHP/Javascript code to create a drop down list. It's part of a longer group of code which dynamically changes a second drop down list based on what's chosen here. After the user submits their choice, I use PHP to grab relevant information, based on their choice, from my database. They're going to be going through the process several times and it would be great if I could reselect whatever they just posted. Might there be a way to reselect whatever they $_POSTed the first time? If I could have some guidance for this piece of the code,
PHP Code:
$q1=mysql_query("select * from assignments_topics");
echo mysql_error();
$already_listed_chapters=array();[code]....
View 8 Replies
ADVERTISEMENT
Jan 6, 2011
I'm currently designing a form with client-side validation using javascript. I've set the input property to display as the value (for example, "your name" inside the name field) and I've set the javascript to clear value using name.focus but everytime I reselect the field to edit the value, it clears again, so I'm trying to make it so that on the 2nd time it get's selected, the nameClear funtion doesn't run.Here's what I've got so far, but it's not working. For some reason, the else statement within the function that runs on .focus is showing as invalid in my debugger, but it looks fine to me.
name.focus(function() {
if(name.val("Your name"))
name.val("");
[code].....
View 2 Replies
View Related
Aug 27, 2009
I thought this would be straightforward but i can't seem to find out or work out how to access a variable posted via a form on the previous page. I have the following line in some jQuery code:
Code:
$( '#ddlSelectBox > OPTION[value=8]' ).attr('selected', true);
I basically want to check for the value sent via $_POST, then use it to make sure a dropdown is populated with the posted value (in the code above, where "value=8", i need to replace the 8 with whatever value has been posted. I have LiveHTTP headers and can see the value i want being posted as job_id=whatever - i just don't know how to get it
View 1 Replies
View Related
Mar 18, 2007
At the moment I have this function, which passes variables to a php file with $_get
function savePath() {
//store title
pathTitle = 'pathTitle=' + document.getElementById("pathTitle").value;
//pathLength = getPathLength();
window.location.href = "save-path2.php?"+pathTitle;
}
but I need to use $_post
function savePath() {
//store title so we can use $_post
pathTitle = 'pathTitle=' + document.getElementById("pathTitle").value;
data = '<form action="save-path2.php" name="formData" method="post">
<input type="hidden" name="pathTitle" value="'+pathTitle+'" />
</form>'
document.formData.submit();
}
How would i automaticly submit the form?
View 1 Replies
View Related
Mar 24, 2010
Is there a way to use javascript to utilize the $_POST array instead of the $_GET array? I've got the following, which uses $_GET array, and I'd like to make it use $_POST instead:
location.href="webpage1.php?my_fieldname=" + (my_fieldvalue);
View 3 Replies
View Related
Aug 26, 2009
I'm using a script I picked up from elsewhere that allows you to do uploading through AJAX (well, actually through an IFRAME,but lets not get into whether that's really AJAX ). Anyway, the script works great except for one little problem though.Sometimes when it submits the ajax form and gets to the server, my $_POST data is empty.The only correlation I've found is I believe it happens when the file I'm uploading is too big (though I'm not exactly sure what the cut off mark is). Regardless, small files aren't causing problems and large ones mean I have no $_POST data on the server when I get there. Here's the script I'm using:
Code:
/**
*
* AJAX IFRAME METHOD (AIM)[code]....
why this might destroy my POST data?
View 3 Replies
View Related
Sep 6, 2010
I have found the following code and wish to have it do a POST instead of the GET
ajax.php
<?php
if (is_numeric($_GET['client_id'])) {
include("database.php");
$query="SELECT * FROM `client_addresses` WHERE `client_id` = '". db_input($_GET['client_id']) ."'";
[Code]...
View 5 Replies
View Related
Dec 12, 2009
I'm created a set amount of dynamic elements based on some elements in another form to try to submit them when the current form is submitted and this just doesnt work. It creates all the elements succesfully and puts in their proper names and values, but on the next page they are not available in $_POST in php.Here's the exact javascript I'm using, I tried appendChild and innerHTML,
Code:
var elem = document.getElementById('submission_options').elements;
for(var k = 0; k < elem.length; k++)
{[code].....
View 1 Replies
View Related
Oct 11, 2011
A <select> box is dynamically created based on a table in the database. Using jQuery, the user can then select multiple email addresses (the value of the options in the select box), and remove them from the select box completely. This leaves only the email addresses the user wants to include in the email.
The problem I've encountered is that the once the user is done removing options they don't wish to include, they have to then select all the remaining options before hitting submit in order for the mail processor to see them as addresses to include.I was thinking maybe instead of the submit button, I just create another button tied to a jQuery function that selects all the remaining values, and then submits the form for the user?
View 1 Replies
View Related
Jun 16, 2009
my issue is both a php and a javascript (AJAX) one its one or the other. I have two combo boxes one dependant on the other, populated by AJAX but when I submit the form the secondary combo is not being registered as a php $_POST['var'] in the following action page. The secondary combo is contained and altered using divs and inner.HTML. Is this an expected behaviour or is my issue else where?
View 3 Replies
View Related
Jul 2, 2009
I am using Roshan's Ajax dropdown code for my two ajax dropdown menus. All is working fine, but when I want to use $_POST in the submitted form with FireFox, its not working...??? Its working fine in IE.
[Code]...
View 1 Replies
View Related
Sep 26, 2011
I can't make it work, echo $_POST["eAdresse"] is undefined.code page 1:
<
script
type
=
"text/javascript">[code].....
View 13 Replies
View Related
Jun 3, 2011
I am trying to use the jquery radio buttons and everything looks well until I press the submit button.What is passed on in my POST variable for the radio buttons is the string "on" and not at all the name of the button. All of the buttons just returns "on".[URL]
View 3 Replies
View Related