Jump to content

Modified box - from a list to a dropdown


Guest hartmurmur

Recommended Posts

Guest hartmurmur

I'll try to explain the best I can.

I've modified one of the side column boxes so the items display in a dropdown - similar to the "Language" or "Currency" boxes. The difference between mine and the Language and Currency boxes is that I would like a Submit button to trigger the selection, not a JavaScript onchange event.

Back to the problem...

I put the submit button in and everything works fine. However, when I change the submit button so it uses an image instead of the browser's default form button, I get X and Y coordinates passed to the URL. These X/Y coordinates are the position that my mouse clicked on the image.

This is not a big problem as the X and Y parameters in the URL are not used, but I wonder how to get rid of them. My suspicion is that the xtpl.php file is doing something with it, but I admit that file is pretty foreign to me. If I had to guess, it'd be in the parsing of the blocks and sub-blocks.

PHP OOP experts out there?

Link to comment
Share on other sites

Guest hartmurmur

Well, here's the gist. I'm not posting my real code because it is a modification (my own templates), but the same exact result can be seen by doing something similar with the siteDocs.tpl file.

File: siteDocs.tpl (located in skins -> your skin -> StyleTemplates -> boxes)

Changing to a dropdown with the following code puts X and Y coords in the URL when the form is submitted using an image instead of a regular form submit button. Let's get rid of it.

<!-- BEGIN: site_docs -->

<div class="siteDocs">

	<form action="index.php" method="get">

  <input type="hidden" name="act" value="viewDoc" />

  <select name="docId">

  	<!-- BEGIN: a -->

  	<option value="{DATA.doc_id}">{DATA.doc_name}</option>

  	<!-- END: a -->

  </select>

  <input type="image" name="submit" src="/images/go.png" />

	</form>

</div>

<!-- END: site_docs -->




ORIGINAL CODE FOR REFERENCE:


<!-- BEGIN: site_docs -->

<div class="siteDocs">

<!-- BEGIN: a -->

<a href="index.php?act=viewDoc&amp;docId={DATA.doc_id}" class="txtSiteDocs">{DATA.doc_name}</a>

<!-- BEGIN: sep --><span class="txtSiteDocs">|</span><!-- END: sep -->

<!-- END: a -->

</div>

<!-- END: site_docs -->

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...