Home › Forums › Quform WordPress › HTTP Links doesnt work on single/paragraph fields
- This topic has 7 replies, 3 voices, and was last updated 10 years, 10 months ago by
spelorzi.
- AuthorPosts
- June 27, 2014 at 7:00 pm #11616
spelorzi
ParticipantHi, i have a field that the user needs to put a link, if he uses http://www.xxxxx.com the form will not work/submit data, if he removes http:// it does work… any idea how can i fix this?
And secondly, i’m trying to redirect the user upon submit to hes newly created form, but this page/link has a custom uniqueid, how can i make this redirection?…
Sorry for my bad english! i also sent you this info by email.
Thanks!
S.
June 29, 2014 at 3:42 pm #11634Ally
Support StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
July 1, 2014 at 6:15 am #11646spelorzi
ParticipantThe redirection code worked perfectly, thanks
On the http problem, you are right, it does have mod_Security on the host side. i prefer to leave it that way.
But, is there a way to detect if the user puts a link with HTTP:// and remove it when he clicks submit, or at least alert him when he types it on the field in the form?
Thanks Ally!
July 1, 2014 at 5:02 pm #11657josef777
ParticipantYou can use the Description or the tooltip to inform the user not to use http:// but is you want to use javascript just add a HTML field and put the following in it
<script>
jQuery(document).ready(function ($){
$('.iphorm_1_1').keyup(function(){
var s= $(this).val();
if (s.indexOf("http://") != -1)
alert("please without http://");
});
});
</script>
change .iphorm_1_1 to your field ID
July 1, 2014 at 5:16 pm #11658spelorzi
ParticipantThanks josef777. I’m still learning/reading about JavaScript (Reading Eloquent Javascript right now).
Now, with your code i get a popup to remove the link as soon as i type/copy it, but if i click okay i can keep going and try to submit.
Is there something i can add there so when the alert happens it also REMOVES http:// for the user? , and will this work if the user types multiple links?. If its not possible to remove ONLY http:// and leaves the rest. Then some sort of script to remove all the field i guess, but will really like to only remove http:// like i said.
Sorry if i ask for too much, i would really love to know how to do it myself, but i’m still in early learning of jscript :(.
Thanks for your help in advance.
S.
- This reply was modified 10 years, 10 months ago by
spelorzi.
July 1, 2014 at 9:06 pm #11660josef777
Participanttry this http://jsfiddle.net/Xotic750/kyKsK/ or wait for ally , i am sure he has a better solution !
July 2, 2014 at 3:51 pm #11736Ally
Support StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
July 2, 2014 at 4:45 pm #11749spelorzi
ParticipantAwesome Ally! Thanks!, also thanks Josef777!
- This reply was modified 10 years, 10 months ago by
- AuthorPosts
- You must be logged in to reply to this topic.