EagerWolf Posted February 22, 2007 Share Posted February 22, 2007 print ("<a onClick='javascript: submitform()' href='?$var1=$var2&$var3=$_SESSION[$var3]'>Next >></a>"); In case my this link is clicked, onClick doesn't work... but href does... I want to submit form and show next step... Does anyone know the solution? Thanks! Link to comment https://forums.phpfreaks.com/topic/39612-solved-onclick-href/ Share on other sites More sharing options...
redarrow Posted February 22, 2007 Share Posted February 22, 2007 why use javascript use a normal html link then use $_GET[''] on the pages. Link to comment https://forums.phpfreaks.com/topic/39612-solved-onclick-href/#findComment-191153 Share on other sites More sharing options...
skali Posted February 22, 2007 Share Posted February 22, 2007 <a href='#' onclick='submitform();'>whatever</a> Link to comment https://forums.phpfreaks.com/topic/39612-solved-onclick-href/#findComment-191154 Share on other sites More sharing options...
EagerWolf Posted February 22, 2007 Author Share Posted February 22, 2007 JS is used, couse this is text link ... I have 2 urls ... NO.1: Back ... It should go a step backward ... NO.2: Next ... It should go a step forrward ... I don't understand, how can I call next or previous page... <form method="POST" id="formgen" name="formgen" action="<? $_SERVER['PHP_SELF']; ?>"> </form> print ("<a onClick='javascript: submitform()' href='?$var1=$var2&$var3=$_SESSION[$var3]'>Back >>"); print ("<a onClick='javascript: submitform()' href='?$var1=$var2&$var3=$_SESSION[$var3]'>Next >>"); $var1 and $var2 tell where to go... $var1 is set before... $var2 depands on which is clicked ... Next or Back... Can you give an example... Thanks! Link to comment https://forums.phpfreaks.com/topic/39612-solved-onclick-href/#findComment-191161 Share on other sites More sharing options...
skali Posted February 22, 2007 Share Posted February 22, 2007 If you are trying to move between browser history you can use js functions. history.go(-1); history.go(1); otherwise use <form method="POST" id="formgen" name="formgen" action="<? $_SERVER['PHP_SELF']; ?>?$var1=$var2&$var3=$_SESSION[$var3]"> </form> print ("<a onClick='javascript: submitform()' href='?$var1=$var2&$var3=$_SESSION[$var3]'>Next >>"); so you will have GET variables alonghwith the form post data. Link to comment https://forums.phpfreaks.com/topic/39612-solved-onclick-href/#findComment-191167 Share on other sites More sharing options...
EagerWolf Posted February 22, 2007 Author Share Posted February 22, 2007 I've tried this to ... In this case ... onClick doesn't work ... data isn't saved, but next page is shown... Link to comment https://forums.phpfreaks.com/topic/39612-solved-onclick-href/#findComment-191172 Share on other sites More sharing options...
skali Posted February 22, 2007 Share Posted February 22, 2007 Oh, im sorry remove href='?$var1=$var2&$var3=$_SESSION[$var3]' Link to comment https://forums.phpfreaks.com/topic/39612-solved-onclick-href/#findComment-191173 Share on other sites More sharing options...
EagerWolf Posted February 22, 2007 Author Share Posted February 22, 2007 <form method="POST" id="formgen" name="formgen" action="<? $_SERVER['PHP_SELF'];?> ?$var1=$var2&$var3=$_SESSION[$var3]"> </form> print ("<a onClick='javascript: submitform()'>Next >>"); So code should look like this? Why is ?$var1=$var2&$var3=$_SESSION[$var3]"> ... It will be just printed the way it is ... It will be HTML code.. Link to comment https://forums.phpfreaks.com/topic/39612-solved-onclick-href/#findComment-191176 Share on other sites More sharing options...
itsmeArry Posted March 1, 2007 Share Posted March 1, 2007 instead of this action="<? $_SERVER['PHP_SELF'];?> ?$var1=$var2&$var3=$_SESSION[$var3]"> use this <?php $action = $_SERVER['PHP_SELF']."?".$var1=$var2."&".$var3."=".$_SESSION[$var3]; action="<?php echo $action?>" Link to comment https://forums.phpfreaks.com/topic/39612-solved-onclick-href/#findComment-196935 Share on other sites More sharing options...
EagerWolf Posted March 2, 2007 Author Share Posted March 2, 2007 Thanks for all your help ... I've solved the problem using JS... So my steps are being stored in div layers ... which are not visible ... When a new layer is called, it just reset it's visibility ... Thanks for your help ppl! Link to comment https://forums.phpfreaks.com/topic/39612-solved-onclick-href/#findComment-197741 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.