Stand Alone Entry Form (SAEF) on iPhone; input name issue
Posted: 16 May 2008 08:23 PM   [ Ignore ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1729
Joined  03-26-2006

I’m developing a Stand Alone Entry Form that has a lot of numeric inputs - and most of the submissions will be made from an iPhone, rather than through a regular browser.

I’ve been reading up on how to default the form input to the numeric keyboard, generally by adding “zip” or “phone” to the name of the input field like this:

<input type="text" name="somefield_zip" value="" />


That works really well. I’m hardcoding the form input fields in my SAEF like this:

<input type="text" name="field_id_12" value="" />


I’m assuming if I add phone or zip to that, it won’t add to the correct field in the DB:

<input type="text" name="field_id_12_zip" value="" />


I’m not sure how to get around this. My main idea is to do the following:

<input type="text" name="somefield_zip" value="" />
<
input type="hidden" name='field_id_12' value="" />


I’d enter a number into the first field which will default to the numeric keys because of the ‘_zip”, and use some JavaScript to populate the hidden field with the value of the first field upon form submission.

I don’t have to default to the numeric keys, but it makes form entry on this form much much faster - I have about six numeric fields in a row on this particular form.

Any thoughts on this appreciated…thanks!

 Signature 

ryan masuga
—————
Masuga Design | Member, EE Pro Network
My EE Add-Ons | {devot:ee}
Twitter: masuga | masugadesign | devot_ee

Profile
 
 
Posted: 16 May 2008 11:09 PM   [ Ignore ]   [ # 1 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1729
Joined  03-26-2006

For the record, this seems to work:

<input type="text" id="myfield" name="myfield_zip" value="" />
<
input type="hidden" id='field_id_7' name='field_id_7' value="" />


Then, in the Javascript (I’m using jQuery):

$(document).ready(function(){
  
$("#myfield").blur(function() {
    
$("#field_id_7").val($(this).val());
  
});


I tried ‘keyup’, ‘change’, and finally settled on ‘blur’ as the only thing I could get the iPhone to recognize consistently and correctly.

Again, this is because I had to append the input name with “_zip” in order to get the iPhone to default to the numeric keys rather than the letter keys. Now I can enter things in this weblog faster from my phone than I can from the Control Panel. BOOM!

 Signature 

ryan masuga
—————
Masuga Design | Member, EE Pro Network
My EE Add-Ons | {devot:ee}
Twitter: masuga | masugadesign | devot_ee

Profile
 
 
Posted: 17 May 2008 12:21 AM   [ Ignore ]   [ # 2 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32895
Joined  05-14-2004

That’s really interesting, Ryan.  Could be a great wiki article if you can find the time; I know I may be able to make use of this in the future and I’ll ever find the thread again. wink

 Signature 
Profile
MSG
 
 
Posted: 17 May 2008 12:48 AM   [ Ignore ]   [ # 3 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1729
Joined  03-26-2006

One other thing. Because this is on the iPhone I want the least code possible on the page. I’m using a SAEF, which is kicking out that really lengthy liveUrlTitle() function that I’m not even using, because I’m auto-generating unique titles/URL titles like this:

<input type="hidden" name="title" id="title" value="entry{current_time}" />
<
input type="hidden" name="url_title" id='url_title' value="entry{current_time}" />


Is there any way to disable the SAEF from kicking out all that unused JavaScript?

 Signature 

ryan masuga
—————
Masuga Design | Member, EE Pro Network
My EE Add-Ons | {devot:ee}
Twitter: masuga | masugadesign | devot_ee

Profile
 
 
Posted: 17 May 2008 01:33 AM   [ Ignore ]   [ # 4 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6563
Joined  04-15-2006

A way around it without hacking into the core files would be to set up your SAEF exactly as you want it to look then view the rendered source code for the form and copy-paste the form into a new template. It should still work as it did before but it will instead be hard-coded. You can then use as much or as little of the form as you may or may not need in your situation.

Admittedly any time you want to make changes to the form you will need to re copy-paste unless you can figure out the form without doing that but sometimes it is a bit quicker to do this than trying to find ways around items that may require a hack to either the module or the core files.

Don’t know if that helps at all though.

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 29 August 2008 02:39 PM   [ Ignore ]   [ # 5 ]  
Summer Student
Total Posts:  11
Joined  11-05-2006

That’s really cool! Great work.

I second Lisa’s suggestion about making a wiki article.

Profile
 
 
Posted: 02 September 2008 07:08 AM   [ Ignore ]   [ # 6 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1729
Joined  03-26-2006

Just noting that as of iPhone 2.0.x the “_zip” trick no longer works - there is apparently, as I write this, no working solution for defaulting to the numeric keypad. I originally picked up the trick here.

 Signature 

ryan masuga
—————
Masuga Design | Member, EE Pro Network
My EE Add-Ons | {devot:ee}
Twitter: masuga | masugadesign | devot_ee

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64978 Total Logged-in Users: 30
Total Topics: 82017 Total Anonymous Users: 19
Total Replies: 440823 Total Guests: 178
Total Posts: 522840    
Members ( View Memberlist )