Change from checkbox to clickable link

This is a discussion on Change from checkbox to clickable link within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hi everybody, I have a small problem and i don't know where to start. The following: I have a ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-02-2007
Rikoos
 
Posts: n/a
Default Change from checkbox to clickable link

Hi everybody,

I have a small problem and i don't know where to start.

The following:

I have a running Joomla CMS system with a component eventlist which is
written in PHP. Members are able to select event in the agenda and
able to mark a check box to let others to know the will attend this
event (this is shown in there profile and also shown at the event
agenda item.

I want to change this to a clickable link, so user don't have to mark
the checkbox and confirm this by clicking a button. When a member is
not already registered for a event there will be a clickable link with
something like "Add to personal agenda". If already registered a link
will be shown with something like "Remove from personal agenda".

The component is generating the following code:

<form name="Eventlist" action="index.php" method="post">
<input type="hidden" NAME="option" value="com_eventlist">
<input type="hidden" NAME="Itemid" value="56">
<input type="hidden" NAME="rdid" value="1573">
<input type="hidden" NAME="func" value="userregister">
Ik ga naar dit evenement: <input type="checkbox" name="reg_check"
onClick="check(this, document.Eventlist.senden)">
<br /><br />
<input type="submit" name="senden" value="Inschrijven " disabled>
</form>

<script language="JavaScript">
function check(checkbox, senden) {
if(checkbox.checked==true){
senden.disabled = false;
} else {
senden.disabled = true;
}
}
</script>





In the component code the following code is responsible for generating
the above code:


<?php
$jetzt = date("Y-m-d");
$now = strtotime($jetzt);
$date = strtotime($row->dates);
$timecheck = $now - $date;
if ($timecheck <= 0) {
if ($my->id) {
if (!$usercheck) {
if (!$usercheck) {
?>
<form name="Eventlist" action="index.php"
method="post">
<input type="hidden" NAME="option"
value="<?php echo $option ; ?>">
<input type="hidden" NAME="Itemid"
value="<?php echo $Itemid ; ?>">
<input type="hidden" NAME="rdid" value="<?php
echo $row->did ; ?>">
<input type="hidden" NAME="func"
value="userregister">
<?php echo _EVENTS_REGISTRA_REG." "; ?>
<input type="checkbox" name="reg_check"
onClick="check(this, document.Eventlist.senden)">
<br /><br />
<input type="submit" name="senden"
value="<?php echo _EVENTS_REGISTRA_BUTTON." "; ?>" disabled>
</form>

<script language="JavaScript">
function check(checkbox, senden) {
if(checkbox.checked==true){
senden.disabled = false;
} else {
senden.disabled = true;
}
}
</script>
<?php
} else {
if ($row->unregistra == 0) {
echo _EVENTS_REGISTRA_ALLRE." ";
} else {
?>
<form name="Eventlist" action="index.php"
method="post">
<input type="hidden" NAME="option"
value="<?php echo $option ; ?>">
<input type="hidden" NAME="Itemid"
value="<?php echo $Itemid ; ?>">
<input type="hidden" NAME="rdid" value="<?php
echo $row->did ; ?>">
<input type="hidden" NAME="func"
value="delreguser">
<?php echo _EVENTS_REGISTRA_UNREG." "; ?>
<input type="checkbox" name="reg_check"
onClick="check(this, document.Eventlist.senden)">
<br /><br />
<input type="submit" name="senden"
value="<?php echo _EVENTS_REGISTRA_BUTTON_UNREG." "; ?>" disabled>
</form>

<script
language="JavaScript">
function check(checkbox, senden) {
if(checkbox.checked==true){
senden.disabled = false;
} else {
senden.disabled = true;
}
}
</script>

<?php
}//ende
unregistra
}//ende usercheck
} else {
echo
_EVENTS_REGISTRA_LOGIN." ";
}//ende my->id
} else {
echo _EVENTS_REGISTRA_TOLATE."
";
}//ende timecheck
?>


Could somebody help me to change this checkbox into a clickable link?
Or maybe if you have some examples where this is done?

It would be very big step forward for me as i only recently started to
learn php so please be not to expert in replies ;)

Cheers
Rick

























Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 02:13 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0