1
marijun
notification_select update button
  • 2004/7/11 8:27

  • marijun

  • Just popping in

  • Posts: 53

  • Since: 2004/6/4 1


i'm trying to convert all the buttons on my XOOPS site into images, and i'm having some trouble with one of them on the notfication_select template.

of course, input type="image" was my first choice, but its not working. i get a blank page when i click on it.

i also tried a plain img tag with onclick="submit()", and i still got the blank page. no fair!

anybody know what i should do to make it actually submit the form? its going to the right page, but something is missing, its not actually updating the notification options. some guidance would be greatly appreciated.

2
Dave_L
Re: notification_select update button
  • 2004/7/11 9:07

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


This one?

<input type="submit" name="not_submit" value="<{$lang_updatenow}>" />


Hmmm ... I don't see anything unusual about that.

3
marijun
Re: notification_select update button
  • 2004/7/11 9:29

  • marijun

  • Just popping in

  • Posts: 53

  • Since: 2004/6/4 1


there's nothing unusual about that...except its not an image ;) i'm trying to replace the standard buttons with images, like so:

<input type="image" src="/themes/mj/dark/update.gif" name="not_submit" value="<{$lang_updatenow}>" />


or:

<img src="/themes/mj/dark/update.gif" name="not_submit" onclick="submit()" />

4
Dave_L
Re: notification_select update button
  • 2004/7/11 9:44

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Yes, I understand. I meant that I couldn't see any reason why that particular button would behave differently than buttons on other templates.

Have you viewed the page source, to ensure the generated HTML is correct?

You could also add this to the script that handles the submitted form, to ensure that the form input is getting passed properly. You might try it both for the orginal template and for your modified one, to see if there are any differences:

var_dump('_REQUEST'$_REQUEST); #*#DEBUG#



5
marijun
Re: notification_select update button
  • 2004/7/11 19:40

  • marijun

  • Just popping in

  • Posts: 53

  • Since: 2004/6/4 1


oh ok sorry.

i tested it out on my newbb board index page. here's what the script generates normally:

<input type="submit" name="not_submit" class="button" value="Update Now" />


and here's the result:

string(8"_REQUEST" array(7) { ["not_redirect"]=> string(24"/modules/newbb/index.php" ["not_list"]=> array(3) { [1]=> array(2) { ["params"]=> string(18"global,0,new_forum" ["status"]=> string(1"1" } [2]=> array(1) { ["params"]=> string(17"global,0,new_post" } [3]=> array(1) { ["params"]=> string(21"global,0,new_fullpost" } } ["not_submit"]=> string(10"Update Now" ["NewBBLastVisit"]=> string(10"1089575837" ["newbb_topic_lastread"]=> string(24"a:1:{i:10;i:1089530182;}" ["NewBBLastVisitTemp"]=> string(10"1089535671" ["PHPSESSID"]=> string(32"2875ee93a53db81056033d0f397067d8" }


here's what it generates when changed to an image:

<input type="image" src="/themes/mj/dark/update.gif" name="not_submit" value="Update Now" />


and here's the result:

string(8"_REQUEST" array(8) { ["not_redirect"]=> string(24"/modules/newbb/index.php" ["not_list"]=> array(3) { [1]=> array(2) { ["params"]=> string(18"global,0,new_forum" ["status"]=> string(1"1" } [2]=> array(1) { ["params"]=> string(17"global,0,new_post" } [3]=> array(1) { ["params"]=> string(21"global,0,new_fullpost" } } ["not_submit_x"]=> string(2"37" ["not_submit_y"]=> string(2"11" ["NewBBLastVisit"]=> string(10"1089575890" ["newbb_topic_lastread"]=> string(24"a:1:{i:10;i:1089530182;}" ["NewBBLastVisitTemp"]=> string(10"1089535671" ["PHPSESSID"]=> string(32"2875ee93a53db81056033d0f397067d8" }


i read somewhere that when you use input type="button" that it automatically sends the image's position on the page (in pixels) to the server in X Y coordinates. looks like that's what its doing with not_submit_x and not_submit_y. grr!

here's the result when i use a plain img src onclick="submit()" button:

string(8"_REQUEST" array(6) { ["not_redirect"]=> string(24"/modules/newbb/index.php" ["not_list"]=> array(3) { [1]=> array(2) { ["params"]=> string(18"global,0,new_forum" ["status"]=> string(1"1" } [2]=> array(1) { ["params"]=> string(17"global,0,new_post" } [3]=> array(1) { ["params"]=> string(21"global,0,new_fullpost" } } ["NewBBLastVisit"]=> string(10"1089576296" ["newbb_topic_lastread"]=> string(24"a:1:{i:10;i:1089530182;}" ["NewBBLastVisitTemp"]=> string(10"1089535671" ["PHPSESSID"]=> string(32"2875ee93a53db81056033d0f397067d8" }


any idea what i should do? i can't figger out why its not submitting the form properly. here's what my notification_select template looks like:

<{if $xoops_notification.show}>
<
table width="100%" border="0" cellpadding="0" cellspacing="0">
<
form name="notification_select" action="<{$xoops_notification.target_page}>" method="post">
<
input type="hidden" name="not_redirect" value="<{$xoops_notification.redirect_script}>" />
  <
tr>
    <
td colspan="3"><br /><{$lang_notificationmethodis}>: <font class="bold"><{$user_method}>font> [<a href="<{$editprofile_url}>"><{$lang_change}>a>]<br /><br />td>
  tr>
  <
tr>
    <
td valign="top"><font class="bold"><{$lang_category}>:font>td>
    <
td><input name="allbox" id="allbox" onclick="xoopsCheckAll('notification_select','allbox');" type="checkbox" value="<{$lang_checkall}>" />td>
    <
td><{$lang_events}>td>
  tr>
<{foreach 
name=outer item=category from=$xoops_notification.categories}>
<{foreach 
name=inner item=event from=$category.events}>
  <
tr>
<{if 
$smarty.foreach.inner.first}>
    <
td rowspan="<{$smarty.foreach.inner.total}>" valign="top"><font class="bold"><{$category.title}>:font>td>
<{/if}>
    <
td><{counter assign=index}><input type="hidden" name="not_list[<{$index}>][params]" value="<{$category.name}>,<{$category.itemid}>,<{$event.name}>" /><input type="checkbox" id="not_list[]" name="not_list[<{$index}>][status]" value="1" <{if $event.subscribed}>checked<{/if}> />td>
    <
td><{$event.caption}>td>
  tr>
<{/foreach}>
<{/foreach}>
  <
tr>
    <
td colspan="3" align="center"><img src="/themes/mj/dark/update.gif" name="not_submit" value="<{$lang_updatenow}>" onclick="submit()" />td>
  tr>
form>
table>
<{/if}>


edit: sorry bout the long code

6
Dave_L
Re: notification_select update button
  • 2004/7/11 21:04

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


This looks like the problem:

include/notification_update.php

if (!isset($HTTP_POST_VARS['not_submit'])) {
   exit();
}


Other than that check, that variable doesn't appear to be referenced.

I would try adding a hidden form field named "not_submit" in the template:

<input type="hidden" name="not_submit" value="Update Now" />


You might need to change the name of the image tag to something other than "not_submit". I don't remember whether you can have two form fields with the same name.

Login

Who's Online

498 user(s) are online (146 user(s) are browsing Support Forums)


Members: 0


Guests: 498


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Aug 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits