Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-05-2013, 03:37 AM   PM User | #1
CoolKay
Regular Coder

 
Join Date: Jan 2011
Posts: 296
Thanks: 7
Thanked 0 Times in 0 Posts
CoolKay is an unknown quantity at this point
do away with the submit button?

My php guy cannot figure out how to do away with the submit box - um, like if I had a drop down menu and a visitor clicked on a entry of it - I would like it to go immediately to a different php inset selection on the page - (to load it in the center of the page vertically down.... like a events list - in otherwords to replace just the center of the page php code) WITHOUT using a submit button. Can someone tell us where to go to get info on how to do this? is this a php or a html funtion?
CoolKay is offline   Reply With Quote
Old 01-05-2013, 04:00 AM   PM User | #2
weir-07
New Coder

 
Join Date: Sep 2007
Posts: 98
Thanks: 25
Thanked 4 Times in 4 Posts
weir-07 is an unknown quantity at this point
Try... <select name="name" onChange="this.form.submit()"> ...
weir-07 is offline   Reply With Quote
Old 01-06-2013, 10:21 PM   PM User | #3
CoolKay
Regular Coder

 
Join Date: Jan 2011
Posts: 296
Thanks: 7
Thanked 0 Times in 0 Posts
CoolKay is an unknown quantity at this point
<select name="name" onChange="this.form.submit()">
This is apparently the first line of a html dropbox yes?
I need to know what I should put in "this.form.submit()"

Can you direct me to a html refeence that would tell me?
CoolKay is offline   Reply With Quote
Old 01-06-2013, 10:28 PM   PM User | #4
AndrewGSW
Senior Coder

 
Join Date: Apr 2011
Location: London, England
Posts: 2,120
Thanks: 15
Thanked 354 Times in 353 Posts
AndrewGSW will become famous soon enough
Quote:
I need to know what I should put in "this.form.submit()"
You don't put anything in there, it just submits the form.
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS
AndrewGSW is offline   Reply With Quote
Old 01-07-2013, 12:02 AM   PM User | #5
CoolKay
Regular Coder

 
Join Date: Jan 2011
Posts: 296
Thanks: 7
Thanked 0 Times in 0 Posts
CoolKay is an unknown quantity at this point
Hi, Andrew and thanks for the reply
We are having a issue.
I want to have a drop down list of type of events on countyfairgrounds.net
- when the user clicks a type of event in this drop down box - it would automatically pull the type of that event - say home and garden shows - from our MySQL databse WITHOUT hitting a submit button.... and we cannot figure out how to submit a form without the button - that is the issue. I am doing some Yahoo browser searches but no results so far.
CoolKay is offline   Reply With Quote
Old 01-07-2013, 12:27 AM   PM User | #6
AndrewGSW
Senior Coder

 
Join Date: Apr 2011
Location: London, England
Posts: 2,120
Thanks: 15
Thanked 354 Times in 353 Posts
AndrewGSW will become famous soon enough
As far as I can see your question has already been answered:

Code:
<select name="name" onchange="this.form.submit()">
When somebody chooses an option from the select list, this will immediately submit the form (that the select is contained within).

This, of course, is assuming that the select is contained within a form, which has a method and an action, and that you have a page that processes the submitted data.
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS
AndrewGSW is offline   Reply With Quote
Old 01-07-2013, 02:02 AM   PM User | #7
tangoforce
Senior Coder

 
tangoforce's Avatar
 
Join Date: Feb 2011
Location: Your Monitor
Posts: 3,502
Thanks: 45
Thanked 439 Times in 428 Posts
tangoforce will become famous soon enoughtangoforce will become famous soon enough
Quote:
Originally Posted by CoolKay View Post
- when the user clicks a type of event in this drop down box - it would automatically pull the type of that event - say home and garden shows - from our MySQL databse WITHOUT hitting a submit button
Quote:
Originally Posted by AndrewGSW View Post
Code:
<select name="name" onchange="this.form.submit()">
I think what the op is looking for Andrew is an ajax request that sends off the selected item and then returns a list of events for it which are then displayed in the page without the page actually submitting.

They've not worded it very well though.
__________________
Please wrap your code in [php] tags. It is a sticky topic and it HELPS us to HELP YOU!
TIP: Coding styles and $end errors :::::::::: TIP: Warning: Cannot modify header information - headers already sent :::::::::: TIP: Quotes / Parse error: syntax error, unexpected T_..
PHP Code:
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value. 
Explanation: The IE if(isset($_POST['submit'])) bug explained.
tangoforce is online now   Reply With Quote
Old 01-07-2013, 06:04 AM   PM User | #8
AndrewGSW
Senior Coder

 
Join Date: Apr 2011
Location: London, England
Posts: 2,120
Thanks: 15
Thanked 354 Times in 353 Posts
AndrewGSW will become famous soon enough
Quote:
I think what the op is looking for Andrew is an ajax request that sends off the selected item and then returns a list of events for it which are then displayed in the page without the page actually submitting.

They've not worded it very well though.
That had occurred to me as well, but the OP stressed "without clicking a submit button" so I assumed that he already had the form-submission set up.
__________________
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
Validate your HTML and CSS
AndrewGSW is offline   Reply With Quote
Reply

Bookmarks

Tags
no submit button, submit button

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:33 AM.


Advertisement
Log in to turn off these ads.