Anyone have any ideas?
I'm at a bit of a loss here.
If I click any button on the page, it's going to go to upload.php, which is fine, I can do queries and get the data I need to display in variables there, but how do I redirect the user back to the previous page, and get the variables available there, and then set the elements to those variables.
I don't need an answer, just an idea of what method to use....
User Profile
Collapse
-
-
Javascript: Refer to element within DIV tag
Hey,
I have a form, and I'm working on validation, half way through the form, I have a <DIV> tag that contains the rest of the elements in the form, it seems I can access the elements before the <DIV> tag, but not after, after googling I've found the getelementbyID function, but not sure if it will do what I want. Picture something like this:
Code:<form> <input id="test" name="test">
-
Thanks for the reply, but I'm not sure I quite understand what your saying.
I'm very new to HTML/Javascript/PHP ... like 2 weeks new lol.
Your saying that I should let it POST to upload.php, then once there, save the data to an XML file, then redirect (how?) back to the main page, and load the values from xml (also not sure how?).
Thanks again for taking the time to reply.Leave a comment:
-
Looking around a bit more, it looks like another option may be to have a section in my page that queries my database (when the user selects "Display") based on the WebID, stores them each in variables, and then sets all the controls at once using Javascript, any thoughts on this as well?Leave a comment:
-
Thanks a lot for the reply.
If I'm understanding it correctly, you have a page with 2 input controls on it, if it's the first load of the page, all values are empty, but if submit had been hit, then it queries the database to populate the controls, correct?
I wish I had asked this before programming most of the App.
I have it setup like this:
Code:<?php echo'<select name="TSH1">';
Leave a comment:
-
Form to submit, but also display data?
Hello, like everyone else on here, I'm looking for some help, but I'm thinking this should be fairly simple for people who know the language.
I've got an HTML form full of drop downs and input boxes that a user fills out, then they hit Submit and using the POST method it goes to an upload.php page I wrote, that uploads all of their values to a database, and presents them with the unique Web ID it generated.
Now, I need... -
I take it by your answer, no such thing exists :p
I'm new to all of this, so not sure the proper name, but I basically set the name of my drop down box as:
Code:name="citysTest[]"
Code:$citysTesting = $_POST['citysTest'];
Leave a comment:
-
Got it! :)
I used an HTML array (I didn't know they existed), this solved that problem.
Thanks for all the help.Leave a comment:
-
Ok, I've found the problem, and spend the past couple hours trying to solve it, but I'm just not getting it. If anyone could give me a pointer that would be awesome
I have my first drop down, which when selected runs the getcity function:
Code:<select size="1" name="itemType1" onChange="getCity('material1','findcity.php?matNum=citys1&itemType='+this.value)"><option selected
Leave a comment:
-
THANK YOU, that makes sense to me, I'll take a look and report back (possibly not until monday).Leave a comment:
-
Ahhh, that's a good idea actually, and I don't see the drop-down being populated in HTML, so I guess that is my problem :(
Code:<select size="1" name="itemType1" onChange="getCity('material1','findcity.php?itemType='+this.value)"><option selected value=""></option> <option value="M">Material</option><option value="1">PH1</option>
Leave a comment:
-
Notice: Undefined index: city1 in C:\wamp\www\TS\ upload.php on line 8
So city1 is a drop down in my main php page, then when the form is submitted (to upload.php), I try to set a variable to the $_POST["city"] value, but it's not setting (for some reason)Leave a comment:
-
Thanks for the reply, and the explanation of the SPAM filter.
I think I understand post 8, setting it to a default value if it isn't already set, I just don't understand why mine is not getting set.
I set the drop down to a value, and then hit submit to submit the form, all of my other POST variables are set, but this specific one is not, it's also the only one using AJAX...I've spent endless time staring at the code,...Leave a comment:
-
I wrote a whole long response, and it stated it had to be approved before it was shown, that was yesterday...wha t gives?Leave a comment:
-
Thanks for the reply, I've had some fires at work and couldn't come back until now.
It's definitely NOT setting the $_POST variable for the "city" drop downs, I just don't get why, is it possible the <SPAN> is some how preventing this?
I basically have a drop down that you select that determines what gets populated in the "city" drop down:
Code:<code> <select size="1"
Leave a comment:
-
Now I'm getting even more confused.
I changed around the code a bit. On my form, I have rows of drop downs and fields. The first 3 are correct, and getting data from the database, the rest were just place holders until I was sure everything was working.
Well, I replaced most of the place holders with the code from the first 3 rows of drop downs and input boxes (incrementing variable names with a number), and now when I submit...Leave a comment:
-
Yeah, sorry for the ugliness :( My first time making a site, I used a form builder to lay everything out, unfortunately it did a messy job of formatting the HTML code.
These are the fields that fail:
Notice: Undefined index: city2 in C:\wamp\www\TS\ upload.php on line 8
Notice: Undefined index: city3 in C:\wamp\www\TS\ upload.php on line 8
Notice: Undefined index: edate in C:\wamp\www\TS\ upload.php...Leave a comment:
-
I warn you, it is not pretty, but thank you very much for replying!
Code:<?php session_start(); if(isset($_SESSION['loggedin'])) { if(($_SESSION['loggedin']) == 'true') { // echo 'yes true'; } else header("location:login.php"); // echo 'no not true'; } else header("location:login.php"); // echo 'no';
Leave a comment:
-
Notice: Undefined index: Scales ...but it is defined? :S
Hey,
I'm thinking this is something simple, as I'm a PHP/Web Dev newb, been asked to develop an app for work, so I'm stumbling my way through this, any how, I get the error:
Notice: Undefined index: Scales in C:\wamp\www\TS\ upload.php on line 31
Here is a bit of the code that declares it:
Code:<p></p></div> <p> </p> <p>
No activity results to display
Show More
Leave a comment: