![]() |
Web form / Select (beginner)
Hello,
Is it possible modify this form Code:
<form name="input" action=""> |
OK, now when you submit the form it will get validated by js and redirected.
There's a fall back with PHP as well if you want it. PHP Code:
|
That is helpful, thanks, but it doesn't quite work, yet.
I copy pasted this Quote:
The "You did not make a selection" functionality, however, works. |
Aaarrrggghhh... I HATE JAVASCRIPT!
I don't know why the javascript isn't working, I've checked on various sources and it appears to be the right syntax. The PHP works, I can guarantee that. As not everyone will have javascript enabled, it would be wise to have the PHP fall back anyway. Someone help with the javascript, please... |
Opening a file containing:
Code:
<html>Code:
<html> |
I would do something along the line of:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
I tried a load of things after posting that. I too realised it only worked outside of a function. I find it weird and incredibly frustrating, but javascript is my worst enemy at the best of times!
I promise myself to buy a book on js next pay day ;) Do you not wish to use server side scripting? |
<select id="merchant" onchange="location.href = this[this.selectedIndex].value">
and then they don't even need to press the submit button (so you could hide the button if JavaScript is enabled but leave it there so that the value can be submitted to a server side script to do the redirect when JavaScript is disabled). |
Amazing!!!
I definately need to buy a book on javascript. Cheers. Quote:
|
actually, you don't need the first
return false;Code:
|
Quote:
|
Quote:
|
| All times are GMT +1. The time now is 01:24 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.