Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Sobota, 28. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  alternative submit button

phpMyEdit Features     alternative submit button
Odoslať novú tému   Odpovedať na tému    
 
michal     Založený: 17.06.2003   Príspevky: 537   Bydlisko: Slovakia
Príspevok Zaslal: 2003-11-23 00:19
Návrat hore  Odpovedať s citátom     

since dropdown menu for entering values is hardly usable if number of possibilities is higher (i.e. > 100) i made a alternate submit button in the help area when inserting new record. the idea was to store all user inserted data in a session, redirect to the second table, where the client can click on the id (with a special url redirecting back to the first page) pastes this number into the form and restores all data stored in session. so far so easy.

the problem i ran into is how to make this button look. i found two possibilites:
1. type = submit - works fine, but if any field is marked required, javascript will alert. this should happen but only when clicking add/more buttons.
2. type = button - this does not alert, but i cannot see any change in #_POST. submitted page has no indication which and whether a button was hit.

do you have any idea how to make this button work without ruining the required iption ?

thanks

 
michal     Založený: 17.06.2003   Príspevky: 537   Bydlisko: Slovakia
Príspevok Zaslal: 2003-11-26 21:10
Návrat hore  Odpovedať s citátom     

my javascript knowledge improved rapidly over past couple of days.

solution which seems to work is as follows:
1. give a name to the form generated by phpMyEdit (need to hack the class in function create_javascripts() add echo ' name="pme_form"'; somewhere at 833

2. somewhere at the begining of the form give
'<input type="hidden" name="redirect" value="none">'

3. and the real button where needed
<input class="pme-sub" type="button" name="any_name" value="click me" onClick="pme_form.redirect.value='click_me'; pme_form.submit();">
which will change the value from 2. and submit the form

should i post entire code which saves entered data in a session and redirects to another page where clicking on a field this get inserted into the form ?
hope at least the explanation is understandable

 
Odoslať novú tému   Odpovedať na tému    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov