Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Wednesday, November 11, 2026
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Forum  »  alternative submit button

phpMyEdit Features     alternative submit button
Post new topic   Reply to topic    
 
michal     Joined: 17 Jun 2003   Posts: 537   Location: Slovakia
Post Posted: 2003-11-23 00:19
Back to top  Reply with quote     

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     Joined: 17 Jun 2003   Posts: 537   Location: Slovakia
Post Posted: 2003-11-26 21:10
Back to top  Reply with quote     

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

 
Post new topic   Reply to topic    

Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Application form
Report bug on PLATON.SK website · Terms of use · Privacy policy