Connecting Tech Pros Worldwide Forums | Help | Site Map

Clicking on a button does not go to the correct page in Safari.

Newbie
 
Join Date: Aug 2007
Posts: 8
#1: Aug 28 '07
Having trouble with the onclick event in Safari:
Expand|Select|Wrap|Line Numbers
  1. <input type="button" name="update_software" value="Update" onclick="search_form.{$location}_Process.value='Software_Update';search_form.software_id_pk.value='{$software_details[detail].softwareID}';document.search_form.submit();" class="button" />
All this does is bring back to the homepage, it should bring up a new page by processing the value Software_Update.

pbmods's Avatar
Site Moderator
 
Join Date: Apr 2007
Location: Texas
Posts: 5,435
#2: Aug 28 '07

re: Clicking on a button does not go to the correct page in Safari.


Heya, Ebremner. Welcome to TSDN!

Please use CODE tags when posting source code. See the REPLY GUIDELINES on the right side of the page next time you post.

Changed thread title to better describe the problem (did you know that threads whose titles that do not follow the Posting Guidelines actually get FEWER responses?).

I'm going to go ahead and move this thread to the JavaScript forum, where our resident Experts will be better able to help you out.
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#3: Aug 29 '07

re: Clicking on a button does not go to the correct page in Safari.


Show the HTML for search_form.
Newbie
 
Join Date: Aug 2007
Posts: 8
#4: Aug 29 '07

re: Clicking on a button does not go to the correct page in Safari.


The HTML is over 2000 lines, do you need to see it all?
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#5: Aug 29 '07

re: Clicking on a button does not go to the correct page in Safari.


Quote:

Originally Posted by ebremner

The HTML is over 2000 lines, do you need to see it all?

No, just the relevant parts referenced in the onclick.
Newbie
 
Join Date: Aug 2007
Posts: 8
#6: Aug 29 '07

re: Clicking on a button does not go to the correct page in Safari.


Code: (html)
[HTML]
<form name="search_form" method="post" action="/software/" onsubmit="if (this.submitted) return true; else return false;">
<input type="hidden" name="{$location}_Process" value="search" />
<input type="hidden" name="action" value="" />
<input type="hidden" name="subaction" value="" />
<input type="hidden" name="software_details_pk" value="" />
<h2 class="toph2">Search Inventory</h2>
[/HTML]
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#7: Aug 29 '07

re: Clicking on a button does not go to the correct page in Safari.


Try this syntax:
Expand|Select|Wrap|Line Numbers
  1. document.forms['search_form'].elements['{$location}_Process'].value='...';
Reply