RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms
At 7:23 PM -0400 5/30/10, Alice Wei wrote: Tedd, Looks like I finally found the answer to my question, and the key is the term, dependent drop down menu. There is an example that I found here, http://www.huanix.com/files/dependent_select/dependent_select.txt, and after editing everything, looks like what I want is not so far to reach. As I am writing now, I got the code I desired to work after studying what went on in the code from the above link. Thanks for your help, and looks like I solved the problem, I may be able to close the thread now. Alice Alice: An interesting solution. I tested it here: http://php1.net/a/ajax-select-db The database needs a little work -- I wasn't aware that Virginia was a State in Germany. :-) It also needs a little work when someone changes an intermediate selection to null the ones further down the chain -- it only goes one deep. The control also uses GET when I think POST would work better -- at least it would hide the inner-workings of the control from the user. However, if that was what you were looking for then great. Good luck and thread closed. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms
Date: Mon, 31 May 2010 11:56:38 -0400 To: php-general@lists.php.net; aj...@alumni.iu.edu From: tedd.sperl...@gmail.com Subject: RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms At 7:23 PM -0400 5/30/10, Alice Wei wrote: Tedd, Looks like I finally found the answer to my question, and the key is the term, dependent drop down menu. There is an example that I found here, http://www.huanix.com/files/dependent_select/dependent_select.txt, and after editing everything, looks like what I want is not so far to reach. As I am writing now, I got the code I desired to work after studying what went on in the code from the above link. Thanks for your help, and looks like I solved the problem, I may be able to close the thread now. Alice Alice: An interesting solution. I tested it here: http://php1.net/a/ajax-select-db The database needs a little work -- I wasn't aware that Virginia was a State in Germany. :-) It also needs a little work when someone changes an intermediate selection to null the ones further down the chain -- it only goes one deep. The control also uses GET when I think POST would work better -- at least it would hide the inner-workings of the control from the user. However, if that was what you were looking for then great. About the get and post, yes, I did change that to post in my sample, but thanks for pointing it out. Alice Good luck and thread closed. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com _ Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1
RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms
At 12:08 PM -0400 5/29/10, Alice Wei wrote: At the time of writing this, I got all the functionality I wanted, only that it takes 3 submits, which is 4 pages in total, which includes two dependent select menus based on user input by clicking on the radio button and some other static drop downs and text inputs. I am not sure if it is possible to cut it down two only two submits, I just went online and found this, http://www.w3schools.com/dhtml/tryit.asp?filename=trydhtml_event_onchange. If I could change this function to using the radio button, and process the other searching for the dependent drop downs using case statements with PHP , do you think this is a good idea? Anyway, I found this method is kind of ugly for the time being, but less daunting with what I was doing before. Thanks. Alice Alice: The example you provided above is very basic and I think what you want is far more complex. I realize that it's hard to convey what it is that you actually want because you don't know all that can be done -- and the number of possibilities of how to organize controls is far too vast for me to guess. For example, here's another example of what can be done: http://www.webbytedd.com/a/ajax-select/index.php But I know this doesn't fully solve your problem but it comes closer than the example you provided above. Sometimes it's best to story-board what you want so that both you and to whom you're asking questions can have a better idea of the problem. For example, let's say you want to gather data from a user -- in option A, the user is asked Y/N. If the user answers N, then the user is sent to option B. If the user answers Y, then the user is sent to option C. In option B the user is presented with... and Option C the user is presented with... and so on. -- I'm sure you get the idea. So, if you want to continue with this, please prepare a story-board and present your problem again. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms
Date: Sun, 30 May 2010 11:53:44 -0400 To: php-general@lists.php.net; aj...@alumni.iu.edu From: tedd.sperl...@gmail.com Subject: RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms At 12:08 PM -0400 5/29/10, Alice Wei wrote: At the time of writing this, I got all the functionality I wanted, only that it takes 3 submits, which is 4 pages in total, which includes two dependent select menus based on user input by clicking on the radio button and some other static drop downs and text inputs. I am not sure if it is possible to cut it down two only two submits, I just went online and found this, http://www.w3schools.com/dhtml/tryit.asp?filename=trydhtml_event_onchange. If I could change this function to using the radio button, and process the other searching for the dependent drop downs using case statements with PHP , do you think this is a good idea? Anyway, I found this method is kind of ugly for the time being, but less daunting with what I was doing before. Thanks. Alice Alice: The example you provided above is very basic and I think what you want is far more complex. I realize that it's hard to convey what it is that you actually want because you don't know all that can be done -- and the number of possibilities of how to organize controls is far too vast for me to guess. For example, here's another example of what can be done: http://www.webbytedd.com/a/ajax-select/index.php But I know this doesn't fully solve your problem but it comes closer than the example you provided above. Sometimes it's best to story-board what you want so that both you and to whom you're asking questions can have a better idea of the problem. For example, let's say you want to gather data from a user -- in option A, the user is asked Y/N. If the user answers N, then the user is sent to option B. If the user answers Y, then the user is sent to option C. In option B the user is presented with... and Option C the user is presented with... and so on. -- I'm sure you get the idea. So, if you want to continue with this, please prepare a story-board and present your problem again. Cheers, tedd -- Tedd, Looks like I finally found the answer to my question, and the key is the term, dependent drop down menu. There is an example that I found here, http://www.huanix.com/files/dependent_select/dependent_select.txt, and after editing everything, looks like what I want is not so far to reach. As I am writing now, I got the code I desired to work after studying what went on in the code from the above link. Thanks for your help, and looks like I solved the problem, I may be able to close the thread now. Alice --- http://sperling.com http://ancientstones.com http://earthstones.com _ Hotmail is redefining busy with tools for the New Busy. Get more from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2
RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms
At 7:31 PM -0400 5/28/10, Alice Wei wrote: Anything I want? Seriously, I do know how to pass a non-dynamic element from one page to another page, but when I started researching on how to utilize dynamic menus based on user input, I found Ajax, until this problem that I am running into hits me. Is there some way that I could generate dynamic select menus without using Ajax? Or, is that asking too much? Thanks for your help. Alice Alice: No offense, but considering what you posted when you started this exchange, it did not appear that you knew how to use forms. But on the other hand, I don't know what non-dynamic elements are. Now on to your problem -- you want to generate dynamic select menu -- I'm not sure what those are either. I think you need to start using the terminology used in html, controls, and such. You can't just throw terms together hoping that the person at the other end knows what you're talking about. In any event, here's something for you to consider: http://www.webbytedd.com/a/ajax-controls/ It shows how to use javascript to detect user's actions in input elements (i.e., text, radio, checkboxes, etc.) and select elements. From those routines, you should be able to construct whatever dynamic select menus you want. All the code is there -- just review it. It would be a trivial matter to add a Submit button to the form to pass these values to the server via traditional means and thus the Submit was omitted to show how Ajax Controls work. However, it is important to note that the example provided above is not unobtrusive -- it is an early example of how all of this was done. There are more appropriate ways to accomplish this, but they require more abstraction, which would probably lead to more confusion on your part -- no offense meant. I suggest you read DOM Scripting and Advance DOM Scripting both published by Friends of ED. They are well worth the cost/effort to read and would give you a better understanding of the processes involved. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms
Date: Sat, 29 May 2010 11:50:50 -0400 To: php-general@lists.php.net; aj...@alumni.iu.edu From: tedd.sperl...@gmail.com Subject: RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms At 7:31 PM -0400 5/28/10, Alice Wei wrote: Anything I want? Seriously, I do know how to pass a non-dynamic element from one page to another page, but when I started researching on how to utilize dynamic menus based on user input, I found Ajax, until this problem that I am running into hits me. Is there some way that I could generate dynamic select menus without using Ajax? Or, is that asking too much? Thanks for your help. Alice Alice: No offense, but considering what you posted when you started this exchange, it did not appear that you knew how to use forms. But on the other hand, I don't know what non-dynamic elements are. Now on to your problem -- you want to generate dynamic select menu -- I'm not sure what those are either. I think you need to start using the terminology used in html, controls, and such. You can't just throw terms together hoping that the person at the other end knows what you're talking about. In any event, here's something for you to consider: http://www.webbytedd.com/a/ajax-controls/ It shows how to use javascript to detect user's actions in input elements (i.e., text, radio, checkboxes, etc.) and select elements. From those routines, you should be able to construct whatever dynamic select menus you want. All the code is there -- just review it. It would be a trivial matter to add a Submit button to the form to pass these values to the server via traditional means and thus the Submit was omitted to show how Ajax Controls work. However, it is important to note that the example provided above is not unobtrusive -- it is an early example of how all of this was done. There are more appropriate ways to accomplish this, but they require more abstraction, which would probably lead to more confusion on your part -- no offense meant. I suggest you read DOM Scripting and Advance DOM Scripting both published by Friends of ED. They are well worth the cost/effort to read and would give you a better understanding of the processes involved. Cheers, tedd At the time of writing this, I got all the functionality I wanted, only that it takes 3 submits, which is 4 pages in total, which includes two dependent select menus based on user input by clicking on the radio button and some other static drop downs and text inputs. I am not sure if it is possible to cut it down two only two submits, I just went online and found this, http://www.w3schools.com/dhtml/tryit.asp?filename=trydhtml_event_onchange. If I could change this function to using the radio button, and process the other searching for the dependent drop downs using case statements with PHP , do you think this is a good idea? Anyway, I found this method is kind of ugly for the time being, but less daunting with what I was doing before. Thanks. Alice --- http://sperling.com http://ancientstones.com http://earthstones.com _ The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail. http://www.windowslive.com/campaign/thenewbusy?tile=multicalendarocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5
RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms
At 9:19 PM -0400 5/27/10, Alice Wei wrote: I am not sure how to add to the page you have set up, but here is the code with ther portion you have set up: ?php $start = isset($_POST['start']) ? $_POST['start'] : null; ? form action= method=post p Select the type of your starting point of interest:br input type=text name=start value=?php echo($start);? size=20 br / Which Semster is this: select name=semester option value=FallFall/option option value=SpringSpring/option option value=SummerSummer/option /selectbr/ input type=submit name=submit value=Submit /p /form Note, what I provided here does not include anything on the ajax. Hope this answers your question. Alice : I didn't have a question, but here's my revision of your code: http://www.webbytedd.com//alice1/ Please review the code and see how: 1) I captured the select value; 2) and how I used that value to focus the selected option. You say: Note, what I provided here does not include anything on the ajax. I've never put anything on the ajax -- that doesn't make sense. Ajax is simply a way to communicate from the browser to the server and back again without requiring a browser refresh. As the user triggers a client-side event (i.e., click, select, enter text, move a mouse, whatever), a javascript routine then sends data to the server to activate a server-side script, which may, or may not, return data. For example -- with javascript turned ON please review: http://www.webbytedd.com/a/ajax-site/ This is simply a one page template that uses an ajax routine to retrieve data from the server to populate the page based upon what the user triggers (i.e., the visitor clicks a navigational link). If you will review the HTML source code, you will find a very basic HTML template that will remain static for all three apparent pages. If you use the FireFox browser you can review the generated HTML. Now where did the generated HTML come from, you might ask? It came from the server after a request was made from the client to the server and the server responded with the correct data -- all without requiring a browser refresh. That's an example of how ajax works. Keep in mind that using best practices requires you to *first* design forms to collect data WITHOUT requiring javascript and then you can enhance the form to provide additional functionality to those who have javascript turned on. Also keep in mind that you may not need ajax to alter the form. You only need ajax if there is data on the server that needs to be retrieved. Now, please turn javascript OFF in your browser and review my page again: http://www.webbytedd.com/a/ajax-site/ That's an example of NOT following best practices. The visitor is provided nothing if they have javascript turned OFF. Now considering such, what additional functionality do you want your form to do that can't be done already? Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms
Date: Fri, 28 May 2010 12:34:55 -0400 To: aj...@alumni.iu.edu; php-general@lists.php.net From: tedd.sperl...@gmail.com Subject: RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms At 9:19 PM -0400 5/27/10, Alice Wei wrote: I am not sure how to add to the page you have set up, but here is the code with ther portion you have set up: ?php $start = isset($_POST['start']) ? $_POST['start'] : null; ? form action= method=post p Select the type of your starting point of interest:br input type=text name=start value=?php echo($start);? size=20 br / Which Semster is this: select name=semester option value=FallFall/option option value=SpringSpring/option option value=SummerSummer/option /selectbr/ input type=submit name=submit value=Submit /p /form Note, what I provided here does not include anything on the ajax. Hope this answers your question. Alice : I didn't have a question, but here's my revision of your code: http://www.webbytedd.com//alice1/ Please review the code and see how: 1) I captured the select value; 2) and how I used that value to focus the selected option. You say: Note, what I provided here does not include anything on the ajax. I've never put anything on the ajax -- that doesn't make sense. Ajax is simply a way to communicate from the browser to the server and back again without requiring a browser refresh. As the user triggers a client-side event (i.e., click, select, enter text, move a mouse, whatever), a javascript routine then sends data to the server to activate a server-side script, which may, or may not, return data. For example -- with javascript turned ON please review: http://www.webbytedd.com/a/ajax-site/ This is simply a one page template that uses an ajax routine to retrieve data from the server to populate the page based upon what the user triggers (i.e., the visitor clicks a navigational link). If you will review the HTML source code, you will find a very basic HTML template that will remain static for all three apparent pages. If you use the FireFox browser you can review the generated HTML. Now where did the generated HTML come from, you might ask? It came from the server after a request was made from the client to the server and the server responded with the correct data -- all without requiring a browser refresh. That's an example of how ajax works. Keep in mind that using best practices requires you to *first* design forms to collect data WITHOUT requiring javascript and then you can enhance the form to provide additional functionality to those who have javascript turned on. Also keep in mind that you may not need ajax to alter the form. You only need ajax if there is data on the server that needs to be retrieved. Now, please turn javascript OFF in your browser and review my page again: http://www.webbytedd.com/a/ajax-site/ That's an example of NOT following best practices. The visitor is provided nothing if they have javascript turned OFF. Now considering such, what additional functionality do you want your form to do that can't be done already? Cheers, tedd -- Tedd, What I am trying to find out is, when I have my form with a dependent select menu, how can I pass the value of the select menu to another page? I have mentioned in the initial email that if I just allow users to type stuff, it passes the form back to itself and works. However, what I want to do is to allow users click one radio button/checkbox, and use that value to determine which select menu to bring up. However, the information I am only interested in storing, is the value of the select menu and not the radio button/checkbox. Am I making sense here? Alice --- http://sperling.com http://ancientstones.com http://earthstones.com _ The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail. http://www.windowslive.com/campaign/thenewbusy?tile=multicalendarocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5
RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms
On Fri, 2010-05-28 at 15:00 -0400, Alice Wei wrote: Date: Fri, 28 May 2010 12:34:55 -0400 To: aj...@alumni.iu.edu; php-general@lists.php.net From: tedd.sperl...@gmail.com Subject: RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms At 9:19 PM -0400 5/27/10, Alice Wei wrote: I am not sure how to add to the page you have set up, but here is the code with ther portion you have set up: ?php $start = isset($_POST['start']) ? $_POST['start'] : null; ? form action= method=post p Select the type of your starting point of interest:br input type=text name=start value=?php echo($start);? size=20 br / Which Semster is this: select name=semester option value=FallFall/option option value=SpringSpring/option option value=SummerSummer/option /selectbr/ input type=submit name=submit value=Submit /p /form Note, what I provided here does not include anything on the ajax. Hope this answers your question. Alice : I didn't have a question, but here's my revision of your code: http://www.webbytedd.com//alice1/ Please review the code and see how: 1) I captured the select value; 2) and how I used that value to focus the selected option. You say: Note, what I provided here does not include anything on the ajax. I've never put anything on the ajax -- that doesn't make sense. Ajax is simply a way to communicate from the browser to the server and back again without requiring a browser refresh. As the user triggers a client-side event (i.e., click, select, enter text, move a mouse, whatever), a javascript routine then sends data to the server to activate a server-side script, which may, or may not, return data. For example -- with javascript turned ON please review: http://www.webbytedd.com/a/ajax-site/ This is simply a one page template that uses an ajax routine to retrieve data from the server to populate the page based upon what the user triggers (i.e., the visitor clicks a navigational link). If you will review the HTML source code, you will find a very basic HTML template that will remain static for all three apparent pages. If you use the FireFox browser you can review the generated HTML. Now where did the generated HTML come from, you might ask? It came from the server after a request was made from the client to the server and the server responded with the correct data -- all without requiring a browser refresh. That's an example of how ajax works. Keep in mind that using best practices requires you to *first* design forms to collect data WITHOUT requiring javascript and then you can enhance the form to provide additional functionality to those who have javascript turned on. Also keep in mind that you may not need ajax to alter the form. You only need ajax if there is data on the server that needs to be retrieved. Now, please turn javascript OFF in your browser and review my page again: http://www.webbytedd.com/a/ajax-site/ That's an example of NOT following best practices. The visitor is provided nothing if they have javascript turned OFF. Now considering such, what additional functionality do you want your form to do that can't be done already? Cheers, tedd -- Tedd, What I am trying to find out is, when I have my form with a dependent select menu, how can I pass the value of the select menu to another page? I have mentioned in the initial email that if I just allow users to type stuff, it passes the form back to itself and works. However, what I want to do is to allow users click one radio button/checkbox, and use that value to determine which select menu to bring up. However, the information I am only interested in storing, is the value of the select menu and not the radio button/checkbox. Am I making sense here? Alice --- http://sperling.com http://ancientstones.com http://earthstones.com _ The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail. http://www.windowslive.com/campaign/thenewbusy?tile=multicalendarocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5 You could do this a couple of ways: 1) Have all the possible form elements you need and show the one the user needs with Javascript 2) Use ajax to grab the select list you need based on the users selection and add it in to the current form. It doesn't matter if you submit more form elements than you need, just don't use them when the form is submitted to the php script. Thanks, Ash http://www.ashleysheridan.co.uk
RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms
Subject: RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms From: a...@ashleysheridan.co.uk To: aj...@alumni.iu.edu CC: tedd.sperl...@gmail.com; php-general@lists.php.net Date: Fri, 28 May 2010 20:05:29 +0100 On Fri, 2010-05-28 at 15:00 -0400, Alice Wei wrote: Date: Fri, 28 May 2010 12:34:55 -0400 To: aj...@alumni.iu.edu; php-general@lists.php.net From: tedd.sperl...@gmail.com Subject: RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms At 9:19 PM -0400 5/27/10, Alice Wei wrote: I am not sure how to add to the page you have set up, but here is the code with ther portion you have set up: ?php $start = isset($_POST['start']) ? $_POST['start'] : null; ? form action= method=post p Select the type of your starting point of interest:br input type=text name=start value=?php echo($start);? size=20 br / Which Semster is this: select name=semester option value=FallFall/option option value=SpringSpring/option option value=SummerSummer/option /selectbr/ input type=submit name=submit value=Submit /p /form Note, what I provided here does not include anything on the ajax. Hope this answers your question. Alice : I didn't have a question, but here's my revision of your code: http://www.webbytedd.com//alice1/ Please review the code and see how: 1) I captured the select value; 2) and how I used that value to focus the selected option. You say: Note, what I provided here does not include anything on the ajax. I've never put anything on the ajax -- that doesn't make sense. Ajax is simply a way to communicate from the browser to the server and back again without requiring a browser refresh. As the user triggers a client-side event (i.e., click, select, enter text, move a mouse, whatever), a javascript routine then sends data to the server to activate a server-side script, which may, or may not, return data. For example -- with javascript turned ON please review: http://www.webbytedd.com/a/ajax-site/ This is simply a one page template that uses an ajax routine to retrieve data from the server to populate the page based upon what the user triggers (i.e., the visitor clicks a navigational link). If you will review the HTML source code, you will find a very basic HTML template that will remain static for all three apparent pages. If you use the FireFox browser you can review the generated HTML. Now where did the generated HTML come from, you might ask? It came from the server after a request was made from the client to the server and the server responded with the correct data -- all without requiring a browser refresh. That's an example of how ajax works. Keep in mind that using best practices requires you to *first* design forms to collect data WITHOUT requiring javascript and then you can enhance the form to provide additional functionality to those who have javascript turned on. Also keep in mind that you may not need ajax to alter the form. You only need ajax if there is data on the server that needs to be retrieved. Now, please turn javascript OFF in your browser and review my page again: http://www.webbytedd.com/a/ajax-site/ That's an example of NOT following best practices. The visitor is provided nothing if they have javascript turned OFF. Now considering such, what additional functionality do you want your form to do that can't be done already? Cheers, tedd -- Tedd, What I am trying to find out is, when I have my form with a dependent select menu, how can I pass the value of the select menu to another page? I have mentioned in the initial email that if I just allow users to type stuff, it passes the form back to itself and works. However, what I want to do is to allow users click one radio button/checkbox, and use that value to determine which select menu to bring up. However, the information I am only interested in storing, is the value of the select menu and not the radio button/checkbox. Am I making sense here? Alice --- http://sperling.com http://ancientstones.com http://earthstones.com _ The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail. http://www.windowslive.com/campaign/thenewbusy?tile=multicalendarocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5 You could do this a couple of ways: 1) Have all the possible form elements you need and show the one the user needs with Javascript 2) Use ajax to grab the select list you need based on the users selection and add it in to the current form. It doesn't matter if you submit more form elements than you need, just don't use them
RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms
On Fri, 2010-05-28 at 15:12 -0400, Alice Wei wrote: Subject: RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms From: a...@ashleysheridan.co.uk To: aj...@alumni.iu.edu CC: tedd.sperl...@gmail.com; php-general@lists.php.net Date: Fri, 28 May 2010 20:05:29 +0100 On Fri, 2010-05-28 at 15:00 -0400, Alice Wei wrote: Date: Fri, 28 May 2010 12:34:55 -0400 To: aj...@alumni.iu.edu; php-general@lists.php.net From: tedd.sperl...@gmail.com Subject: RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms At 9:19 PM -0400 5/27/10, Alice Wei wrote: I am not sure how to add to the page you have set up, but here is the code with ther portion you have set up: ?php $start = isset($_POST['start']) ? $_POST['start'] : null; ? form action= method=post p Select the type of your starting point of interest:br input type=text name=start value=?php echo($start);? size=20 br / Which Semster is this: select name=semester option value=FallFall/option option value=SpringSpring/option option value=SummerSummer/option /selectbr/ input type=submit name=submit value=Submit /p /form Note, what I provided here does not include anything on the ajax. Hope this answers your question. Alice : I didn't have a question, but here's my revision of your code: http://www.webbytedd.com//alice1/ Please review the code and see how: 1) I captured the select value; 2) and how I used that value to focus the selected option. You say: Note, what I provided here does not include anything on the ajax. I've never put anything on the ajax -- that doesn't make sense. Ajax is simply a way to communicate from the browser to the server and back again without requiring a browser refresh. As the user triggers a client-side event (i.e., click, select, enter text, move a mouse, whatever), a javascript routine then sends data to the server to activate a server-side script, which may, or may not, return data. For example -- with javascript turned ON please review: http://www.webbytedd.com/a/ajax-site/ This is simply a one page template that uses an ajax routine to retrieve data from the server to populate the page based upon what the user triggers (i.e., the visitor clicks a navigational link). If you will review the HTML source code, you will find a very basic HTML template that will remain static for all three apparent pages. If you use the FireFox browser you can review the generated HTML. Now where did the generated HTML come from, you might ask? It came from the server after a request was made from the client to the server and the server responded with the correct data -- all without requiring a browser refresh. That's an example of how ajax works. Keep in mind that using best practices requires you to *first* design forms to collect data WITHOUT requiring javascript and then you can enhance the form to provide additional functionality to those who have javascript turned on. Also keep in mind that you may not need ajax to alter the form. You only need ajax if there is data on the server that needs to be retrieved. Now, please turn javascript OFF in your browser and review my page again: http://www.webbytedd.com/a/ajax-site/ That's an example of NOT following best practices. The visitor is provided nothing if they have javascript turned OFF. Now considering such, what additional functionality do you want your form to do that can't be done already? Cheers, tedd -- Tedd, What I am trying to find out is, when I have my form with a dependent select menu, how can I pass the value of the select menu to another page? I have mentioned in the initial email that if I just allow users to type stuff, it passes the form back to itself and works. However, what I want to do is to allow users click one radio button/checkbox, and use
RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms
Subject: RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms From: a...@ashleysheridan.co.uk To: aj...@alumni.iu.edu CC: tedd.sperl...@gmail.com; php-general@lists.php.net Date: Fri, 28 May 2010 20:14:06 +0100 On Fri, 2010-05-28 at 15:12 -0400, Alice Wei wrote: Subject: RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms From: a...@ashleysheridan.co.uk To: aj...@alumni.iu.edu CC: tedd.sperl...@gmail.com; php-general@lists.php.net Date: Fri, 28 May 2010 20:05:29 +0100 On Fri, 2010-05-28 at 15:00 -0400, Alice Wei wrote: Date: Fri, 28 May 2010 12:34:55 -0400 To: aj...@alumni.iu.edu; php-general@lists.php.net From: tedd.sperl...@gmail.com Subject: RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms At 9:19 PM -0400 5/27/10, Alice Wei wrote: I am not sure how to add to the page you have set up, but here is the code with ther portion you have set up: ?php $start = isset($_POST['start']) ? $_POST['start'] : null; ? form action= method=post p Select the type of your starting point of interest:br input type=text name=start value=?php echo($start);? size=20 br / Which Semster is this: select name=semester option value=FallFall/option option value=SpringSpring/option option value=SummerSummer/option /selectbr/ input type=submit name=submit value=Submit /p /form Note, what I provided here does not include anything on the ajax. Hope this answers your question. Alice : I didn't have a question, but here's my revision of your code: http://www.webbytedd.com//alice1/ Please review the code and see how: 1) I captured the select value; 2) and how I used that value to focus the selected option. You say: Note, what I provided here does not include anything on the ajax. I've never put anything on the ajax -- that doesn't make sense. Ajax is simply a way to communicate from the browser to the server and back again without requiring a browser refresh. As the user triggers a client-side event (i.e., click, select, enter text, move a mouse, whatever), a javascript routine then sends data to the server to activate a server-side script, which may, or may not, return data. For example -- with javascript turned ON please review: http://www.webbytedd.com/a/ajax-site/ This is simply a one page template that uses an ajax routine to retrieve data from the server to populate the page based upon what the user triggers (i.e., the visitor clicks a navigational link). If you will review the HTML source code, you will find a very basic HTML template that will remain static for all three apparent pages. If you use the FireFox browser you can review the generated HTML. Now where did the generated HTML come from, you might ask? It came from the server after a request was made from the client to the server and the server responded with the correct data -- all without requiring a browser refresh. That's an example of how ajax works. Keep in mind that using best practices requires you to *first* design forms to collect data WITHOUT requiring javascript and then you can enhance the form to provide additional functionality to those who have javascript turned on. Also keep in mind that you may not need ajax to alter the form. You only need ajax if there is data on the server that needs to be retrieved. Now, please turn javascript OFF in your browser and review my page again: http://www.webbytedd.com/a/ajax-site/ That's an example of NOT following best practices. The visitor is provided nothing if they have javascript turned OFF. Now considering such, what additional functionality do you want your form to do that can't be done already? Cheers, tedd -- Tedd, What I am trying to find out is, when I have my form with a dependent select menu, how can I pass the value of the select menu to another page? I have mentioned in the initial email that if I just allow users to type stuff, it passes the form back to itself and works. However, what I want to do is to allow users click one radio button/checkbox, and use that value to determine which select menu to bring up. However, the information I am only interested in storing, is the value of the select menu and not the radio button/checkbox. Am I making sense here? Alice --- http://sperling.com http://ancientstones.com http://earthstones.com _ The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail. http://www.windowslive.com/campaign/thenewbusy?tile=multicalendarocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5 You
RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms
On Fri, 2010-05-28 at 15:12 -0400, Alice Wei wrote: What I am trying to find out is, when I have my form with a dependent select menu, how can I pass the value of the select menu to another page? I have mentioned in the initial email that if I just allow users to type stuff, it passes the form back to itself and works. However, what I want to do is to allow users click one radio button/checkbox, and use that value to determine which select menu to bring up. However, the information I am only interested in storing, is the value of the select menu and not the radio button/checkbox. Am I making sense here? and Maybe that is why I cannot pass the information on in the hidden value, but what have I missed here? Ajax? PHP? I am getting confused. Alice Alice: That's the reason why I am taking this in steps instead of hitting you with all the buzz-words you were throwing around when we started. If you don't know how to pass variables from one page to another, then why require ajax? That only complicates the process. There are several methods to pass variables from one page to another. You could have everything contained in a single page, but let's just solve your problem. To pass things from one page to another has been demonstrated to you in the examples I provided, namely: http://webbytedd.com//alice and http://webbytedd.com//alice1 Those forms are passing data as the user clicks submit. Now, you want the user to pick a value and then pass that value to a different page to bring up a different select control, right? Please review this: http://www.webbytedd.com//alice2/index.php That does everything you ask and it does it simply without ajax. From these examples you should be able to create just about anything you want. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms
Date: Fri, 28 May 2010 17:18:21 -0400 To: aj...@alumni.iu.edu From: tedd.sperl...@gmail.com Subject: RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms CC: php-general@lists.php.net On Fri, 2010-05-28 at 15:12 -0400, Alice Wei wrote: What I am trying to find out is, when I have my form with a dependent select menu, how can I pass the value of the select menu to another page? I have mentioned in the initial email that if I just allow users to type stuff, it passes the form back to itself and works. However, what I want to do is to allow users click one radio button/checkbox, and use that value to determine which select menu to bring up. However, the information I am only interested in storing, is the value of the select menu and not the radio button/checkbox. Am I making sense here? and Maybe that is why I cannot pass the information on in the hidden value, but what have I missed here? Ajax? PHP? I am getting confused. Alice Alice: That's the reason why I am taking this in steps instead of hitting you with all the buzz-words you were throwing around when we started. If you don't know how to pass variables from one page to another, then why require ajax? That only complicates the process. There are several methods to pass variables from one page to another. You could have everything contained in a single page, but let's just solve your problem. To pass things from one page to another has been demonstrated to you in the examples I provided, namely: http://webbytedd.com//alice and http://webbytedd.com//alice1/ Those forms are passing data as the user clicks submit. Now, you want the user to pick a value and then pass that value to a different page to bring up a different select control, right? Please review this: http://www.webbytedd.com//alice2/index.php That does everything you ask and it does it simply without ajax. From these examples you should be able to create just about anything you want. Cheers, tedd Anything I want? Seriously, I do know how to pass a non-dynamic element from one page to another page, but when I started researching on how to utilize dynamic menus based on user input, I found Ajax, until this problem that I am running into hits me. Is there some way that I could generate dynamic select menus without using Ajax? Or, is that asking too much? Thanks for your help. Alice -- --- http://sperling.com http://ancientstones.com http://earthstones.com _ The New Busy is not the old busy. Search, chat and e-mail from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3
RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms
From: aj...@alumni.iu.edu To: tedd.sperl...@gmail.com CC: php-general@lists.php.net Subject: RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms Date: Fri, 28 May 2010 19:31:10 -0400 Date: Fri, 28 May 2010 17:18:21 -0400 To: aj...@alumni.iu.edu From: tedd.sperl...@gmail.com Subject: RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms CC: php-general@lists.php.net On Fri, 2010-05-28 at 15:12 -0400, Alice Wei wrote: What I am trying to find out is, when I have my form with a dependent select menu, how can I pass the value of the select menu to another page? I have mentioned in the initial email that if I just allow users to type stuff, it passes the form back to itself and works. However, what I want to do is to allow users click one radio button/checkbox, and use that value to determine which select menu to bring up. However, the information I am only interested in storing, is the value of the select menu and not the radio button/checkbox. Am I making sense here? and Maybe that is why I cannot pass the information on in the hidden value, but what have I missed here? Ajax? PHP? I am getting confused. Alice Alice: That's the reason why I am taking this in steps instead of hitting you with all the buzz-words you were throwing around when we started. If you don't know how to pass variables from one page to another, then why require ajax? That only complicates the process. There are several methods to pass variables from one page to another. You could have everything contained in a single page, but let's just solve your problem. To pass things from one page to another has been demonstrated to you in the examples I provided, namely: http://webbytedd.com//alice and http://webbytedd.com//alice1/ Those forms are passing data as the user clicks submit. Now, you want the user to pick a value and then pass that value to a different page to bring up a different select control, right? Please review this: http://www.webbytedd.com//alice2/index.php That does everything you ask and it does it simply without ajax. From these examples you should be able to create just about anything you want. Cheers, tedd Anything I want? On a second note, after looking at your example again, is it possible to generate what is on form 4 without having to push submit button on form 3? Or, is that another topic in Javascript or something else? Alice -- --- http://sperling.com http://ancientstones.com http://earthstones.com The New Busy is not the old busy. Search, chat and e-mail from your inbox. Get started. _ Hotmail is redefining busy with tools for the New Busy. Get more from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2
Re: [PHP] Select Values Didn't Get Passed in From Two Different Forms
On Fri, May 28, 2010 at 8:01 PM, Alice Wei aj...@alumni.iu.edu wrote: From: aj...@alumni.iu.edu To: tedd.sperl...@gmail.com CC: php-general@lists.php.net Subject: RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms Date: Fri, 28 May 2010 19:31:10 -0400 Date: Fri, 28 May 2010 17:18:21 -0400 To: aj...@alumni.iu.edu From: tedd.sperl...@gmail.com Subject: RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms CC: php-general@lists.php.net On Fri, 2010-05-28 at 15:12 -0400, Alice Wei wrote: What I am trying to find out is, when I have my form with a dependent select menu, how can I pass the value of the select menu to another page? I have mentioned in the initial email that if I just allow users to type stuff, it passes the form back to itself and works. However, what I want to do is to allow users click one radio button/checkbox, and use that value to determine which select menu to bring up. However, the information I am only interested in storing, is the value of the select menu and not the radio button/checkbox. Am I making sense here? and Maybe that is why I cannot pass the information on in the hidden value, but what have I missed here? Ajax? PHP? I am getting confused. Alice Alice: That's the reason why I am taking this in steps instead of hitting you with all the buzz-words you were throwing around when we started. If you don't know how to pass variables from one page to another, then why require ajax? That only complicates the process. There are several methods to pass variables from one page to another. You could have everything contained in a single page, but let's just solve your problem. To pass things from one page to another has been demonstrated to you in the examples I provided, namely: http://webbytedd.com//alice and http://webbytedd.com//alice1/ Those forms are passing data as the user clicks submit. Now, you want the user to pick a value and then pass that value to a different page to bring up a different select control, right? Please review this: http://www.webbytedd.com//alice2/index.php That does everything you ask and it does it simply without ajax. From these examples you should be able to create just about anything you want. Cheers, tedd Anything I want? On a second note, after looking at your example again, is it possible to generate what is on form 4 without having to push submit button on form 3? Or, is that another topic in Javascript or something else? Alice -- --- http://sperling.com http://ancientstones.com http://earthstones.com The New Busy is not the old busy. Search, chat and e-mail from your inbox. Get started. _ Hotmail is redefining busy with tools for the New Busy. Get more from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2 Alice, I'm not really sure what you're looking for, but this page has examples of forms that are dynamically generated using AJAX. Perhaps sifting through the code (and using tools like the Web Developer plugin) will give you some ideas: http://nephtaliproject.com/nedit/ Adam -- Nephtali: PHP web framework that functions beautifully http://nephtaliproject.com
RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms
At 3:50 PM -0400 5/26/10, Alice Wei wrote: My bad, I cannot imagine I sent that stuff. To answer your question, here it is, form action= method=post pSelect the type of your starting point of interest:br/ input type=text name=start size=20 maxlength=50/ input type=submit value=submit name=submit/p /form This is what is working now if I do it this way, but again, then I got to make sure everything is typed up properly before the form is submitted. Does this answer your questions by any chance? Alice Alice: Okay, not bad -- here's my addition: http://www.webbytedd.com//alice/ Please review the code. I removed the maxlength because that's something you should do server-side anyway. Never trust anything coming from the client-side. Also note that closing the tags, such as br/ is optional -- IF -- you're not planning on using XML. Otherwise they will generate a W3C short-tags warning. However, that's not a fatal error. Also note the Submit button statement has three attributes. Type states the type of input statement, value is what the button displays to the user (i.e., Submit) and name is the name of the variable that you can access via a POST/GET. Also note how the form collects the start value from a POST and then repopulates the form after it has the data. This important to understand. Clicking the Submit button sends the form's data to the server which then sends it back to the browser via a refreshed form. Also note the ternary operator I used, namely: $start = isset($_POST['start']) ? $_POST['start'] : null; The first time the page is viewed, POST is sampled for content. If there is no content, then checking for content will generate an error unless we first check to see if it has content, hence the isset(). If it doesn't have content, then the statement assigns NULL to $start. If it does have content, then it will assign that value to $start, understand? Now, what's next? What other data do you want to collect? You mentioned a select control that derived its data from a database. But before we go to that, show me a select control working in a form with embedded values -- in other words, just a simple select control. Please add it to the form we have. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms
Date: Thu, 27 May 2010 12:23:46 -0400 To: aj...@alumni.iu.edu; php-general@lists.php.net From: tedd.sperl...@gmail.com Subject: RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms At 3:50 PM -0400 5/26/10, Alice Wei wrote: My bad, I cannot imagine I sent that stuff. To answer your question, here it is, form action= method=post pSelect the type of your starting point of interest:br/ input type=text name=start size=20 maxlength=50/ input type=submit value=submit name=submit/p /form This is what is working now if I do it this way, but again, then I got to make sure everything is typed up properly before the form is submitted. Does this answer your questions by any chance? Alice Alice: Okay, not bad -- here's my addition: http://www.webbytedd.com//alice/ Please review the code. I removed the maxlength because that's something you should do server-side anyway. Never trust anything coming from the client-side. Also note that closing the tags, such as br/ is optional -- IF -- you're not planning on using XML. Otherwise they will generate a W3C short-tags warning. However, that's not a fatal error. Also note the Submit button statement has three attributes. Type states the type of input statement, value is what the button displays to the user (i.e., Submit) and name is the name of the variable that you can access via a POST/GET. Also note how the form collects the start value from a POST and then repopulates the form after it has the data. This important to understand. Clicking the Submit button sends the form's data to the server which then sends it back to the browser via a refreshed form. Also note the ternary operator I used, namely: $start = isset($_POST['start']) ? $_POST['start'] : null; The first time the page is viewed, POST is sampled for content. If there is no content, then checking for content will generate an error unless we first check to see if it has content, hence the isset(). If it doesn't have content, then the statement assigns NULL to $start. If it does have content, then it will assign that value to $start, understand? Now, what's next? What other data do you want to collect? You mentioned a select control that derived its data from a database. But before we go to that, show me a select control working in a form with embedded values -- in other words, just a simple select control. Please add it to the form we have. Cheers, tedd I am not sure how to add to the page you have set up, but here is the code with ther portion you have set up: ?php $start = isset($_POST['start']) ? $_POST['start'] : null; ? form action= method=post p Select the type of your starting point of interest:br input type=text name=start value=?php echo($start);? size=20 br / Which Semster is this: select name=semester option value=FallFall/option option value=SpringSpring/option option value=SummerSummer/option /selectbr/ input type=submit name=submit value=Submit /p /form Note, what I provided here does not include anything on the ajax. Hope this answers your question. Alice -- --- http://sperling.com http://ancientstones.com http://earthstones.com _ The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail. http://www.windowslive.com/campaign/thenewbusy?tile=multicalendarocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5
RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms
On Tue, 2010-05-25 at 15:41 -0400, Alice Wei wrote: Date: Tue, 25 May 2010 13:40:44 -0400 Subject: Re: [PHP] Select Values Didn't Get Passed in From Two Different Forms From: marc.g...@gmail.com To: aj...@alumni.iu.edu I would like to take those values away into my third form, which is what you see with the hidden. If they are not populated, then how come I could see the drop down menus? So you're expecting the values selected in the first two forms to populate the values of the hidden fields in the third form? Why not wrap the whole thing in a single form? Do test_getrss.php and test_getrss2.php perform anything useful or are they just hanging around? No, the fields are populated in the first and second form, form1 and form2. What I want to do is to get the selections from both forms and pass them on to the third. Does this make sense? For some reason, the text input and the semester drop down menu result can be passed to process.php, but the results that I try to select from the first and second does not. So, the form is not passing the results of what I had from the radio button selections. To illustrate, the second looks something like this: echo select name='end_location'; while($nt=mysql_fetch_array($result)){//Array or records stored in $nt echo option value=$nt[0]$nt[0]/option; } echo /select; How can I pass the values of what I picked in end_location here to process.php? Thanks for your help. Alice _ The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail. http://www.windowslive.com/campaign/thenewbusy?tile=multicalendarocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5 You can only pass results from both forms if you duplicate the results of one in the other and then submit that one. You can't submit two forms at the same time. Why do they have to be two forms anyway? Well, two of them are created with Ajax that are passed through PHP, so you select one drop down menu are a time, as the drop down menu comes from what you select from a radio button. The results are dynamically. so I don't think they are even created at the same time. Does this help in explaining what I am trying to accomplish? Thanks. Thanks, Ash http://www.ashleysheridan.co.uk You should get the Ajax to modify the first form. It's a lot easier than creating a second form that uses more Ajax to duplicate any selected values from the first. Have a look at the JQuery library, it makes a lot of the Javascript end a lot easier. I know this is not a PHP question, but could you direct me to something more specific on what I should do here? I am really new to Ajax. Thanks, Ash http://www.ashleysheridan.co.uk _ Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1
RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms
On Wed, 2010-05-26 at 08:28 -0400, Alice Wei wrote: On Tue, 2010-05-25 at 15:41 -0400, Alice Wei wrote: Date: Tue, 25 May 2010 13:40:44 -0400 Subject: Re: [PHP] Select Values Didn't Get Passed in From Two Different Forms From: marc.g...@gmail.com To: aj...@alumni.iu.edu I would like to take those values away into my third form, which is what you see with the hidden. If they are not populated, then how come I could see the drop down menus? So you're expecting the values selected in the first two forms to populate the values of the hidden fields in the third form? Why not wrap the whole thing in a single form? Do test_getrss.php and test_getrss2.php perform anything useful or are they just hanging around? No, the fields are populated in the first and second form, form1 and form2. What I want to do is to get the selections from both forms and pass them on to the third. Does this make sense? For some reason, the text input and the semester drop down menu result can be passed to process.php, but the results that I try to select from the first and second does not. So, the form is not passing the results of what I had from the radio button selections. To illustrate, the second looks something like this: echo select name='end_location'; while($nt=mysql_fetch_array($result)){//Array or records stored in $nt echo option value=$nt[0]$nt[0]/option; } echo /select; How can I pass the values of what I picked in end_location here to process.php? Thanks for your help. Alice _ The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail. http://www.windowslive.com/campaign/thenewbusy?tile=multicalendarocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5 You can only pass results from both forms if you duplicate the results of one in the other and then submit that one. You can't submit two forms at the same time. Why do they have to be two forms anyway? Well, two of them are created with Ajax that are passed through PHP, so you select one drop down menu are a time, as the drop down menu comes from what you select from a radio button. The results are dynamically. so I don't think they are even created at the same time. Does this help in explaining what I am trying to accomplish? Thanks. Thanks, Ash http://www.ashleysheridan.co.uk You should get the Ajax to modify the first form. It's a lot easier than creating a second form that uses more Ajax to duplicate any selected values from the first. Have a look at the JQuery library, it makes a lot of the Javascript end a lot easier. I know this is not a PHP question, but could you direct me to something more specific on what I should do here? I am really new to Ajax. Thanks, Ash http://www.ashleysheridan.co.uk _ Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1 Try a google search for jquery. The first site that comes up contains all the documentation and examples to get you started. Thanks, Ash http://www.ashleysheridan.co.uk
RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms
From: Alice Wei On Tue, 2010-05-25 at 15:41 -0400, Alice Wei wrote: Date: Tue, 25 May 2010 13:40:44 -0400 Subject: Re: [PHP] Select Values Didn't Get Passed in From Two Different Forms From: marc.g...@gmail.com To: aj...@alumni.iu.edu I would like to take those values away into my third form, which is what you see with the hidden. If they are not populated, then how come I could see the drop down menus? So you're expecting the values selected in the first two forms to populate the values of the hidden fields in the third form? Why not wrap the whole thing in a single form? Do test_getrss.php and test_getrss2.php perform anything useful or are they just hanging around? No, the fields are populated in the first and second form, form1 and form2. What I want to do is to get the selections from both forms and pass them on to the third. Does this make sense? For some reason, the text input and the semester drop down menu result can be passed to process.php, but the results that I try to select from the first and second does not. So, the form is not passing the results of what I had from the radio button selections. Alice, What you seem to be missing is that the browser, by design, will only send the fields in the form that was submitted. If you want to change that you need to either replace the browser with one you modified to act the way you want, or change the page to combine all of the forms into one. You can try to work around it using Javascript, but that will only work for people that don't know enough to disable that primary infection vector for malware. Bob McConnell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms
At 9:17 PM -0400 5/25/10, Alice Wei wrote: No, the fields are populated in the first and second form, form1 and form2. What I want to do is to get the selections from both forms and pass them on to the third. Does this make sense? For some reason, the text input and the semester drop down menu result can be passed to process.php, but the results that I try to select from the first and second does not. So, the form is not passing the results of what I had from the radio button selections. To illustrate, the second looks something like this: Alice: No offense, but Looking like something isn't going to cut it. I advise you to: 1. Show us the code. -- give us a url where your code is located. 2. Tell us what you *want* to do -- and don't show us with it looks something like this nonsense. 3. Get the simple stuff to work first before jumping into the harder stuff. If you are willing to do the above, then I'll help you with your problem. Please understand that forms are very simple with very simple rules to follow. Enhancing forms with javascript routines can become complicated very quickly. But if you can describe it, it can be done. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms
Date: Wed, 26 May 2010 09:19:26 -0400 To: php-general@lists.php.net; aj...@alumni.iu.edu From: tedd.sperl...@gmail.com Subject: RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms At 9:17 PM -0400 5/25/10, Alice Wei wrote: No, the fields are populated in the first and second form, form1 and form2. What I want to do is to get the selections from both forms and pass them on to the third. Does this make sense? For some reason, the text input and the semester drop down menu result can be passed to process.php, but the results that I try to select from the first and second does not. So, the form is not passing the results of what I had from the radio button selections. To illustrate, the second looks something like this: Alice: No offense, but Looking like something isn't going to cut it. I advise you to: 1. Show us the code. -- give us a url where your code is located. 2. Tell us what you *want* to do -- and don't show us with it looks something like this nonsense. 3. Get the simple stuff to work first before jumping into the harder stuff. If you are willing to do the above, then I'll help you with your problem. Please understand that forms are very simple with very simple rules to follow. Enhancing forms with javascript routines can become complicated very quickly. But if you can describe it, it can be done. Cheers, tedd I thought I provided the whole code, but looks like it somehow got lost in the thread. Here is the main file I would like to use for my data entry: Main: ?php // Make a MySQL Connection mysql_connect(localhost, xxx, xxx) or die(mysql_error()); mysql_select_db(yyy) or die(mysql_error()); //The variables posted from the PHP form $start = $_POST[start]; ? ul form action= method=post liSelect the type of your starting point of interest:br/ div id=start_menuform action=test_getrss.php name=form1 method=post spaninput type=radio value=Apartment name=start onclick=check(document.form1.start)/ Apartment /span spaninput type=radio value=Grocery name=start onclick=check(document.form1.start)/ Grocery /span /form/div/li /ul form action=process.php method=post input type=hidden name=form1 value=?php echo $start?/ input type=submit value=Submit name=submit/ input type=reset value=Reset name=reset/ /form /body /html This is the script that I use to construct the drop down menu in test_getrss.php ?php //get the q parameter from URL // Make a MySQL Connection mysql_connect(localhost, xxx, xxx) or die(mysql_error()); mysql_select_db(xxxe) or die(mysql_error()); $q=$_GET[q]; $query=SELECT name FROM start_from WHERE type=' . $q . '; //find out which feed was selected $result = mysql_query ($query); echo select name='start_location'; // printing the list box select command while($nt=mysql_fetch_array($result)){//Array or records stored in $nt echo option value=$nt[0]$nt[0]/option; /* Option values are added by looping through the array */ } echo /select;// Closing of list box ? See, I am trying to get the users pick something from the select name=start_location and have the info in there to pass on to process.php ?php //get the q parameter from URL // Make a MySQL Connection mysql_connect(localhost, xxx, xxx) or die(mysql_error()); mysql_select_db(yyy) or die(mysql_error()); $form1 = $_POST['form1']; echo Start Location . $form1 . br /; ? Therefore, the radio button info. does not need to be recorded. This is not the only field I need to pass to process.php, which the data would be used to enter into a database. I am leaving what is not working in my code. I hope this helps in understanding what my problem may be. Thanks for your help. Alice _ The New Busy is not the old busy. Search, chat and e-mail from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3
RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms
Alice: You provide: ul form action= method=post liSelect the type of your starting point of interest:br/ div id=start_menuform action=test_getrss.php name=form1 method=post spaninput type=radio value=Apartment name=start onclick=check(document.form1.start)/ Apartment /span spaninput type=radio value=Grocery name=start onclick=check(document.form1.start)/ Grocery /span /form/div/li /ul form action=process.php method=post input type=hidden name=form1 value=?php echo $start?/ input type=submit value=Submit name=submit/ input type=reset value=Reset name=reset/ /form /body /html You also state: I hope this helps in understanding what my problem may be. It's very apparent that your problem is multifold and to solve it we need to take the solution in steps. First, the above HTML code is just plain horrible -- and that's just html part or the problem -- let alone the more complicated php/mysql/javascript coding. If that is the best html code you can write, then I suggest that you go back to learn html before learning anything else. So, your assignment (if you want me to continue to help) is to create a simple form to collect the data you want. Nothing fancy, just a simple form -- can you do that? The assignment is in your court. If you can show you can do that, then we'll proceed to the next step. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms
Date: Wed, 26 May 2010 15:36:18 -0400 To: php-general@lists.php.net; aj...@alumni.iu.edu From: tedd.sperl...@gmail.com Subject: RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms Alice: You provide: ul form action= method=post liSelect the type of your starting point of interest:br/ div id=start_menuform action=test_getrss.php name=form1 method=post spaninput type=radio value=Apartment name=start onclick=check(document.form1.start)/ Apartment /span spaninput type=radio value=Grocery name=start onclick=check(document.form1.start)/ Grocery /span /form/div/li /ul form action=process.php method=post input type=hidden name=form1 value=?php echo $start?/ input type=submit value=Submit name=submit/ input type=reset value=Reset name=reset/ /form /body /html My bad, I cannot imagine I sent that stuff. To answer your question, here it is, form action= method=post pSelect the type of your starting point of interest:br/ input type=text name=start size=20 maxlength=50/ input type=submit value=submit name=submit/p /form This is what is working now if I do it this way, but again, then I got to make sure everything is typed up properly before the form is submitted. Does this answer your questions by any chance? Thanks for your help. Alice You also state: I hope this helps in understanding what my problem may be. It's very apparent that your problem is multifold and to solve it we need to take the solution in steps. First, the above HTML code is just plain horrible -- and that's just html part or the problem -- let alone the more complicated php/mysql/javascript coding. If that is the best html code you can write, then I suggest that you go back to learn html before learning anything else. So, your assignment (if you want me to continue to help) is to create a simple form to collect the data you want. Nothing fancy, just a simple form -- can you do that? The assignment is in your court. If you can show you can do that, then we'll proceed to the next step. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com _ The New Busy is not the too busy. Combine all your e-mail accounts with Hotmail. http://www.windowslive.com/campaign/thenewbusy?tile=multiaccountocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_4
Re: [PHP] Select Values Didn't Get Passed in From Two Different Forms
On Wed, 26 May 2010 11:02:10 -0400, Alice Wei wrote: [De-indented to preserve sanity] ul form action= method=post Bzzt. Only li elements can be children of ul. liSelect the type of your starting point of interest:br/ div id=start_menu form action=test_getrss.php name=form1 method=post Bzzt. You didn't close the previous form. You can *not* have nested form elements. spaninput type=radio value=Apartment name=start onclick=check(document.form1.start)/ Apartment /span spaninput type=radio value=Grocery name=start onclick=check(document.form1.start)/ Grocery /span Bzzt. Non-standard DOM references. Use check(document.forms.form1.elements.start) or check(this.form.elements.start) or check(this) Note that the first two will pass a collection of elements because you have two controls with the same name. The third will pass a single element. /form/div/li /ul form action=process.php method=post input type=hidden name=form1 value=?php echo $start?/ input type=submit value=Submit name=submit/ input type=reset value=Reset name=reset/ /form Bzzt. An input control with the same name as one of the forms? Wasn't it confusing enough already? /Nisse -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Select Values Didn't Get Passed in From Two Different Forms
Date: Tue, 25 May 2010 13:40:44 -0400 Subject: Re: [PHP] Select Values Didn't Get Passed in From Two Different Forms From: marc.g...@gmail.com To: aj...@alumni.iu.edu I would like to take those values away into my third form, which is what you see with the hidden. If they are not populated, then how come I could see the drop down menus? So you're expecting the values selected in the first two forms to populate the values of the hidden fields in the third form? Why not wrap the whole thing in a single form? Do test_getrss.php and test_getrss2.php perform anything useful or are they just hanging around? No, the fields are populated in the first and second form, form1 and form2. What I want to do is to get the selections from both forms and pass them on to the third. Does this make sense? For some reason, the text input and the semester drop down menu result can be passed to process.php, but the results that I try to select from the first and second does not. So, the form is not passing the results of what I had from the radio button selections. To illustrate, the second looks something like this: echo select name='end_location'; while($nt=mysql_fetch_array($result)){//Array or records stored in $nt echo option value=$nt[0]$nt[0]/option; } echo /select; How can I pass the values of what I picked in end_location here to process.php? Thanks for your help. Alice _ The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail. http://www.windowslive.com/campaign/thenewbusy?tile=multicalendarocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5
RE: [PHP] Select Values Didn't Get Passed in From Two Different Forms
Hi Adam, I am not sure this would help but does echo command end with semi colon ; ?. input type=hidden name=form2 value=?php echo $end?/ Maybe the echo is having some issue? Else, you could try passing the variables as method = get and view the variables in Ur address bar regards, Edwin. -Original Message- From: Adam Richardson [mailto:simples...@gmail.com] Sent: Wednesday, May 26, 2010 1:31 AM To: php-general@lists.php.net Subject: Re: [PHP] Select Values Didn't Get Passed in From Two Different Forms On Tue, May 25, 2010 at 1:17 PM, Alice Wei aj...@alumni.iu.edu wrote: Hi, It is kind of difficult to explain what I am trying to do here, I will provide the form here to give a better idea. ul liSelect the type of your starting point of interest:br/ div id=start_menuform action=test_getrss.php name=form1 method=post spaninput type=radio value=Apartment name=start onclick=check(document.form1.start)/ Apartment /span spaninput type=radio value=Grocery name=start onclick=check(document.form1.start)/ Grocery /span spaninput type=radio value=Drugstore name=start onclick=check(document.form1.start)/ Drug Store /span /form/div/li liSelect the type of your ending point of interest:br/ div id=end_menuform action=test_getrss2.php name=form2 method=post spaninput type=radio value=Apartment name=end onclick=check2(document.form2.end)/ Apartment /span spaninput type=radio value=Grocery name=end onclick=check2(document.form2.end)/ Grocery /span spaninput type=radio value=Drugstore name=end onclick=check2(document.form2.end)/ Drug Store /span /form/div/li form action=process.php method=post liStart Time: input type=text size=12 name=start_time//li liArrive Time: input type=text size=12 name=end_time//li liWhich Semster is this: select name=semester option value=FallFall/option option value=SpringSpring/option option value=SummerSummer/option /selectbr//li input type=hidden name=form1 value=?php echo $start?/ input type=hidden name=form2 value=?php echo $end?/ li style=list-style:noneinput type=submit value=Submit name=submit/ input type=reset value=Reset name=reset//form /ul For some reason, when I pass in the output with process.php, the hidden input does not get passed in. Here is the process.php: ?php //get the q parameter from URL $start_time = $_POST['start_time']; $end_time = $_POST['end_time']; $semester = $_POST['semester']; $form1 = $_POST['form1']; $form2 = $_POST['form2']; echo Start Time . $start_time . br /; echo End Time . $end_time . br /; echo Semester . $semester . br /; echo Start Location . $form1 . br /; echo End Location . $form2 . br /; ? I get values for start_time, end_time and semester, but not the last two values. What have I done wrong here? Thanks for your help. Alice _ The New Busy is not the old busy. Search, chat and e-mail from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:W L:en-US:WM_HMP:042010_3 Where are you setting the variables $start and $end? Adam -- Nephtali: PHP web framework that functions beautifully http://nephtaliproject.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php