corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » Anyone know anything about Java Script/HTML » Post Reply

Post Reply
Who Can Post? All users can post new topics and all users can reply.
Icon:
Formatting Mode:
Normal
Advanced
Help

Insert Bold text Insert Italicized text Insert Underlined text Insert Centered text Insert a Hyperlink Insert Email Hyperlink Insert an Image Insert Code Formatted text Insert Quoted text
Message:
HTML is Off
Smilies are On
BB Code is On
[img] Code is On
Post Options: Disable smileys?
Turn BBCode off?
Receive email notification of new replies?

Joff

posted on 14th Feb 04 at 18:16

Oops - just re-read your first post..


code:

<html>
<head><title>Somepage</title></head>
<body onLoad="document.myForm.submit()">

<form method="post" name="myForm" action="submit.php">
<input type="hidden" value="somevalue" name="txtValue">
</form>

</body>
</html>






[Edited on 14-02-2004 by Joff]


Joff

posted on 14th Feb 04 at 18:13

code:

<form method="post" name="myForm" action="submit.php">
<select name="selOption" onChange="document.myForm.submit();">
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
</select>
</form>


ed

posted on 14th Feb 04 at 18:09

Yea that makes more sense than what I'm trying to do! (My first PHP/MySQL site, so i'm getting a bit confused by it all :lol: )


Dom

posted on 14th Feb 04 at 18:07

no that will submit when the user changes the options in the drop down menu ;)
Although if you want the page to submit when the it loads, then wack a 'onLoad; in the body tag, with the submit javascript and that will do it :) But why the hell you want to submit a page when its loads though :boggle: the reason you submit data is to get user input (change of data etc).
Best bet mate is to create the whole page in php, so it first loads up the options menu - user selects option (form points to that php page eg: page.php) and it submits. Using flags (data kept in hidden form variables), the php script will know that the user has selected an option, get the data, and then throw out another screen with the selected options menu and the data below it etc and you reset the flag. :thumbs:


ed

posted on 14th Feb 04 at 17:48

I used onChange on a different site somewhere, so i'll have a look it how I did that. Will that submit the form when the page loads though?


Dom

posted on 14th Feb 04 at 17:41

basically, you want the drop down menu to automatically sumbit when the user selects an options? if so, then its a case of wacking a 'onchange' within the drop down menu tag and put some javascript in it :) ive forgotten how to do it (just had a play, but cant get it to work) so have a look on google mate, but its something along he lines of 'document.*formname*.submit' :)


ed

posted on 14th Feb 04 at 17:28

I'm doing a website in PHP. I got a drop down menu at the top of a page at the moment that you select an option from to query the MySQL database. BUT to get anything to apear on the page you have to press the submit button as the query works on a form variable. Does anyone know how to get a form to submit automaticaly when a page loads. I think it would use the onLoad = tag in java script but I cant figure anything out! Does anyone on here know anything about this sorta thing??? Thanks for any help ED:thumbs: