<portlet:actionURL var="formDetailsUrl">
<portlet
aram name="customParam" value="nothing"/>
</portlet:actionURL>
<form name="detailForm"
method="post" onsubmit="callFormDetails()">
<select id="topic" name="topic" >
<option ${topic=='1' ? 'selected' : ''} value="1">ONE </option>
<option ${topic=='2' ? 'selected' : ''} value="2">TWO </option>
</select>
<option ${topic=='1' ? 'selected' : ''} value="1">ONE </option>
<option ${topic=='2' ? 'selected' : ''} value="2">TWO </option>
</select>
<input type="submit" value="submit">
</form>
<script type="text/javascript">
function
callFormDetails (contID)
{
var submitURL ='${formDetailsUrl}';
var topic = document.getElementById("topic");
submitURL
= submitURL.replace("nothing",topic);
document.detailForm.action=submitURL;
document.detailForm.submit();
}
</script>
NOTE : In the javascript we can change the parameter for the URl we define. As this helps us in having control in sending dynamic parameters directly in the URl
the submit is not working in my scenario do you have suggestions are know any reasons why it is not working?!!
ReplyDeleteSame the Submit not working in my case as well, do you find any solution for this?
ReplyDeleteCan you please ,let me check your code pls.
ReplyDeleteAlso please note that there was a small spelling mistake at
,
Its param not aram.
This comment has been removed by the author.
DeleteThanks Srikath for helping me, What am trying to achive is one checkbox selection submit a form ,below is
ReplyDeleteJavaScript:
function myFormSubmit() {
var submitURL ='${actionUrl1}';
document.myForm.action=submitURL;
document.myForm.submit();
}
For some reason rest of html tag unable to post in Blog, but I have defined actionUrl1 and MyForm is the form, If you want I can email to you at subinjacob@gmail.com, The stuck at document.myForm.submit() as null
Thanks
-Subin
Please mail your code to srikanthreddy1410@gmail.com.I will check and update you !
ReplyDeleteHi Srikanth, Have you got chance to check code that I emailed to you?
ReplyDelete