Jump to content
The mkiv Supra Owners Club

Little bit of javascript - help?


fri3ndly

Recommended Posts

Basically I have a form which is validated using PHP.

 

When a user selects an option and hits submit, they are taken to step 2 of the process, but I also need a new browser window to open depending on what option they selected.

 

Can anyone help me as I am terrible at javascript? :rolleyes:

Link to comment
Share on other sites

http://www.programmersheaven.com/2/FAQ-JavaScript-Disable-Enable-Form-Elements

 

There are pitfalls to such an approach. You can by default disable a submit button without script - but if for some reason the users browser doesnt support Javascript, they have no way of enabling the submit button.

 

Therefore, it would be wise to disable the submit button on page load via the onload() event handler, then use the onclick() event handler of the 'enabled' submit button to trigger the function that enables the other submit button.

Link to comment
Share on other sites

http://www.programmersheaven.com/2/FAQ-JavaScript-Disable-Enable-Form-Elements

 

There are pitfalls to such an approach. You can by default disable a submit button without script - but if for some reason the users browser doesnt support Javascript, they have no way of enabling the submit button.

 

Therefore, it would be wise to disable the submit button on page load via the onload() event handler, then use the onclick() event handler of the 'enabled' submit button to trigger the function that enables the other submit button.

 

Cool, thanks il give that a try :)

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. You might also be interested in our Guidelines, Privacy Policy and Terms of Use.