Form to PHP

First of all the code:

[php]


Site
Artists
Albums
Tracks
[/php]

The thing I want is this to use javascript like

[php]<form class=“searchform” method=“get” name=“searchform” onSubmit=javascript:function(OnSubmitSearchForm());">[/php]

but this doesn’t work. What do I need to change?

forms use action not onsubmit.

I tried your code and its working fine for me. Below is the code I tried:
[php]


Site
Artists
Albums
Tracks
[/php]

When I click Submit button, Its giving Hi alert Box :slight_smile: .

  1. Check the function name as it is case sensitive
  2. Upgrade ur browser to latest version or see whether it supports javascript :slight_smile: Good Luck

Correct, that was just a typo…:slight_smile:

I know, that part is no problem, but when you change the following line

[php][/php]

into

[php]<form method=“get” name=“searchform” action=javascript:function(OnSubmitSearchForm());">[/php]

Than it doesn’t work

Try the following :

<form class="searchform" method="get" name="searchform" onSubmit="javascript:OnSubmitSearchForm();">

I can’t tell you of this works, but the problem is…I need the ACTION attribute for AJAX implementation.

I don’t think you need javascript: in the action part.

Sponsor our Newsletter | Privacy Policy | Terms of Service